|
-
Nov 2nd, 2007, 09:37 AM
#1
Thread Starter
Hyperactive Member
[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???)
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Nov 2nd, 2007, 09:40 AM
#2
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?
-
Nov 2nd, 2007, 09:41 AM
#3
Re: [2005] Help With SubString Property
Code:
ObjProblemDescription.Substring(75, ObjProblemDescription.Length - 75)
-
Nov 2nd, 2007, 09:54 AM
#4
Thread Starter
Hyperactive Member
Re: [2005] Help With SubString Property
 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?
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Nov 2nd, 2007, 10:02 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] Help With SubString Property
Resolved 
Just didnt specify a length lol
Code:
ObjProblemDescription2 = ObjProblemDescription.Substring(75)
Learning C♯
Data Binding & Bound Controls - Objects and wizards will never be as intelligent as you, do it yourself! (Unless your Pro)
-
Nov 2nd, 2007, 10:03 AM
#6
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|