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
How to store a path in EditBox1.Text via DialogBox control?
Add New record from unbound form
High CPU utilization
Request.PhysicalApplicatio
nPath returns I.P. not URL
Thunderbird slow to download
PHP.ini file 'display_errors' is set to Off but errors still appear on page?
How can I determine from an Office 2010 Volume License key (or product activation key) exactly which version of Office 2010 to download & install from MSDN (msdn.microsoft.com)?
How do I add a Folder to Windows Installer without having to add each individual file
Unattended Windows 7 Installation answer file not working
Wireless Projector Adapter