Microsoft
Software
Hardware
Network
Question : VB.Net String remove everthing after second space in string
Hello I am trying to query from VB.Net, but were I pull my data it gives me full name including lastname, firstname and middle name.
I would like to remove everthing after 2nd white space example
String Sampson, Robert Steve should just be Sampson, Robert
and
String Sahdala, Lesbia P should just be Sahdala, Lesbia
It seems like something I should be able to do with trim command. It seems like a simple thing but can't seem to figure out Syntax.
Anyone have any ideas or maybe maybe have another way
Answer : VB.Net String remove everthing after second space in string
I can't index :(
Dim s as String = "String Sampson, Robert Steve should just be Sampson, Robert"
Dim a() = s.Split(" ")
If a.Length > 2 Then
s = a(0) + a(1)
End If ' else s is unchanged
Random Solutions
Remove underscore from folder names and replace with space
TSQL nested WHILE EXISTS
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
SCCM OSD deployment to Hyper-v R2
Raid 1 mirror Bad block discovered
Unix Perl or Shell script to split a data file by header+trailer
How can I determine if the firewall is not letting through certain TCP packets?
Delete blank line from textarea
Datalist reset all its items when OnItemCommand is fired
How Unlock Ipod Touch If You Forget Your Passcode