Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to manipulate a string.

 

The string has the value = "Johnny Gonzales"

I need it to have the value = "jgonzales"

 

It needs to be flexable enough to account for the original string having different values.

 

Alex Torres

Raymond Cisneros

etc...

 

They are need to end up like:

atorres

rcisneros

etc...

 

I am not quite sure how to accomplish this. Keep in mind that the program has option strict on and that it is in VB.NET. And as always any help is greatly appreciated.

  • Leaders
Posted

In other words

 

   Dim Names() As String = FullName.Split(" "c)
   Dim FormattedName As String = Names(0).Substring(0, 1).ToLower() & Names(1).ToLower()

 

You should probably check that Names.Length = 2 (or if it equals three, assume that Names(1) is the middle name and use Names(2) as the last name)

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...