Print Page | Close Window

Trim one character after a space

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=9542
Printed Date: 01 April 2026 at 1:00am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Trim one character after a space
Posted By: gknapper
Subject: Trim one character after a space
Date Posted: 04 February 2004 at 1:35pm

How can I set this up:

I want to get the users 1st name and last Initial from the Username field.  So if the user is John Doe I get John D?

Thanks,

Greg




Replies:
Posted By: michael
Date Posted: 04 February 2004 at 1:55pm


Dim fullname = "?????? ???????"     'This is your users name
Dim tempname
 tempname = Split(fullname," ")
Dim displayname
displaname = tempname(0) & " " & Left(tempname(1),1)

Now that works only with the user has no middle name. If he does you need to find the upbound of the array and take that for the left function.



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: gknapper
Date Posted: 04 February 2004 at 2:50pm

Thanks for the help........... just had to change:

Dim fullname

fullname = rst("Real_name")

works great!!!!

Thanks agian,

Greg




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net