Roshawn,
In addition to the VB runtime functions r_burgess suggested.
You can use String.Split to split the name.
Dim title As string = "Malicious Mobile Code: Virus Protection for
Windows"
Dim parts() As String = title.Split(":"c)
The parts(0) will contain "Malicious Mobile Code", while parts(1) will
contain " Virus Protection for Windows"
Alternatively you could use String.IndexOf & String.SubString along with
String.Trim to remove leading & trailing white space.
Dim title As string = "Malicious Mobile Code: Virus Protection for
Windows"
Dim index As Integer = title.IndexOf(":"c)
Dim parts(1) As String
parts(0) = title.Substring(0, index).Trim()
parts(1) = title.Substring(index + 1).Trim()
Note you can use String.LastIndexOf if you want to split the name on the
last ":" instead of the first ":" if there are multiple ":" in the name.
I normally avoid mixing the VB runtime functions (InStr, Left, Right, Mid)
with the String methods (String.IndexOf, String.SubString) within the same
function/class/project/solution as the runtime functions are 1 based
indexes, while the String methods are 0 based indexes.
Hope this helps
Jay
"Roshawn" <ud****@bellsouth.net> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
Hi,
I am retrieving a list of book titles from a web service. What I'd like
to
do is shorten the titles, if possible. For example, there is a book
titled
"Malicious Mobile Code: Virus Protection for Windows". It would be nice
if
I could trim the title down to the colon (it would just say Malicious
Mobile
Code).
Is there an easy way to accomplish this task?
Thanks,
Roshawn