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!

Trim or substring

Status
Not open for further replies.

Jcarr38

Programmer
Feb 16, 2007
27
US
I've gotta field in a label that looks like this:

<%# Eval("Name") %>

The output looks like this:
"Sam From San Francisco, CA" .

How can i trim everything except the word name so it'll read just "Sam". Thanks for any help.
 
Dim s as string = "Sam From San Francisco, CA"
YourLabel = s.Substring(0, s.IndexOf(" ", 0))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top