lothos12345 Posted April 8, 2005 Posted April 8, 2005 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. Quote
IngisKahn Posted April 8, 2005 Posted April 8, 2005 Just do a quick browse of String class and you'll find what you need. ToLower, Split, and SubString will do the trick. Quote "Who is John Galt?"
Leaders snarfblam Posted April 8, 2005 Leaders Posted April 8, 2005 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) Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.