|
-
Apr 27th, 2005, 01:46 PM
#1
Thread Starter
Hyperactive Member
String Manipulation (Resolved)
How to get the Characters between two given integers.
For example i have a String "I am ,learning, Vb.net", now i want to get the word "learning" out of this string.
Want command should i use.Remember that there are two commas in the String.
Last edited by Raziiq; Apr 27th, 2005 at 02:31 PM.
-
Apr 27th, 2005, 02:02 PM
#2
I wonder how many charact
Re: String Manipulation
Your example seems off - it doesn't contain any integers.
VB Code:
Dim temp As String = "I am, learning, vb.net"
Dim extraction As String = temp.Substring(temp.IndexOf("learning"),"learning".Length)
-
Apr 27th, 2005, 02:09 PM
#3
Thread Starter
Hyperactive Member
Re: String Manipulation
ok that was great
But what if i have "i have ,2036, pages in this book"
Now if the integer 2036 is different everytime then how to get that 2036 from this string.
For example at first time it is 2036 and if i click button again and then the String is "i have ,480661, pages in this book". how to get this integer out from this string.
-
Apr 27th, 2005, 02:16 PM
#4
I wonder how many charact
Re: String Manipulation
VB Code:
'vb
Dim temp As String = "this is me learning, 2036, pages of .Net";
Dim startIndex As Integer = temp.IndexOf(",") + 1;
Dim endIndex As Integer = temp.IndexOf(",",startIndex);
Dim extraction As String = temp.Substring(startIndex,endIndex-startIndex).Trim;
'c#
int startIndex = temp.IndexOf(",") + 1;
int endIndex = temp.IndexOf(",",startIndex);
string r = temp.Substring(startIndex,endIndex-startIndex).Trim();
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
|