gnappi Posted September 13, 2006 Posted September 13, 2006 I have a variable length string that I need to manipulate. It's 20+ characters long, but I only need the first 3 and second three for example: abcdef 12.5,.76m4---L7,8724... I can get the strip out all but first three (ABC) , and shift them to upper case, but can't find a method to extract the second three or the characters def. Here's my code: str1 = (str1.ToUpper) trimmedString = (str1.Remove(3)) Any ideas? Thanks, Gary Quote
Cags Posted September 13, 2006 Posted September 13, 2006 I'm not entirely sure I've understood what your trying to achieve. Assuming I've understood you at least partially correctly the Method you would need is the SubString() method. Dim str As String = "abc123alskdfjlasdkfj;kl" Dim fstThree As String = str.Substring(0, 3) ' fstThree would be abc Dim secThree As String = str.Substring(3, 3) ' secThree would be 123 Quote Anybody looking for a graduate programmer (Midlands, England)?
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.