Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Space / Build Name 1

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
0
0
GB
Hi

I'm trying to build an output starting with AUTH_USER that consists of First Initial and Surname without any space, for example 'Alexander Smith' becomes 'ASmith' not 'A Smith'

As implemented below I get 'A Smith' and have problems with the length of the surname.

Code:
strNTUserShortName=Left(strNTUserFullName,1)+Right(strNTUserFullName,10)

Basically I want everything to the right of the space and the first initial to the left, can you think of a way to do this before I abandon this idea.

TIA
Webflex


 

try using the split method

myarray = Split(strNTUserFullName)

strNTUserShortName=Left(strNTUserFullName,1) & myarray(1)

Hope this helps

Simon
 
perfect, thanks, works a treat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top