[RESOLVED] [2005] Help With SubString Property
Hi
Well basically I want to extract all the characters from a variable, and I am using the substring propety to do that, I specify the starting character to be 75, but as the variable is always gonig to hold different lengths of data, I cant specify a fixed value, so what should I do?
Code:
If ObjProblemDescription.Length > 75 Then
ObjProblemDescription2 = ObjProblemDescription.Substring(75, ,> 75???)
Re: [2005] Help With SubString Property
How will you know, each time, what the number is, or, will you know is time what the number is?
Re: [2005] Help With SubString Property
Code:
ObjProblemDescription.Substring(75, ObjProblemDescription.Length - 75)
Re: [2005] Help With SubString Property
Quote:
Originally Posted by Hack
How will you know, each time, what the number is, or, will you know is time what the number is?
Well first this is only done if my variable contains 75 or more characters, I have no idea how many characters it will contain TBH, however mabe if I remove characters 1 - 74, and leave the rest, that might work?
SevenHalo, I dont get what your code is suppost to do?
Re: [2005] Help With SubString Property
Resolved :D
Just didnt specify a length lol
Code:
ObjProblemDescription2 = ObjProblemDescription.Substring(75)
Re: [RESOLVED] [2005] Help With SubString Property
The first parameter is the start index, the second if how far you want to substring toparse out.
If your string is 100 characters and you start at 75 (76 actually if you convert from zero based indexes), how would you determine how many characters are left? The length of your string minus the number in which you started.