aaronk Well-Known Member Licensed User Longtime User May 23, 2015 #1 Hi, I have a string and I am trying to get split part of it.. My string is: ...?page=abc123 I am trying to get just the abc123 part of the string. (The ... at the start of the string can change so I can't really use the substring function) Anyone know how to do this ?
Hi, I have a string and I am trying to get split part of it.. My string is: ...?page=abc123 I am trying to get just the abc123 part of the string. (The ... at the start of the string can change so I can't really use the substring function) Anyone know how to do this ?
R rboeck Well-Known Member Licensed User Longtime User May 23, 2015 #2 Look for the position of "?page=" with B4X: Po = String.IndexOf("?page=") + 6 ' Len of Searchstring NewString=String.SubString(Po) Upvote 0
Look for the position of "?page=" with B4X: Po = String.IndexOf("?page=") + 6 ' Len of Searchstring NewString=String.SubString(Po)
I inakigarm Well-Known Member Licensed User Longtime User May 23, 2015 #3 If abc123 is always there (at the end of string) is easy, you've to code a right function with substring or use Right with jstringfunction taking 6 characters long from string (abc123) Upvote 0
If abc123 is always there (at the end of string) is easy, you've to code a right function with substring or use Right with jstringfunction taking 6 characters long from string (abc123)
narek adonts Well-Known Member Licensed User Longtime User May 23, 2015 #4 Is this a url post for php script? Upvote 0
aaronk Well-Known Member Licensed User Longtime User May 23, 2015 #5 Hi, I think I have worked it out and I think this code is going to work: B4X: Dim mystring As String = "pageid=abc123" Dim parameter() As String = Regex.Split("pageid=", mystring) Log(parameter(1)) Upvote 0
Hi, I think I have worked it out and I think this code is going to work: B4X: Dim mystring As String = "pageid=abc123" Dim parameter() As String = Regex.Split("pageid=", mystring) Log(parameter(1))
Erel B4X founder Staff member Licensed User Longtime User May 24, 2015 #6 If you are implementing a server then you can use req.GetParameter. Upvote 0
aaronk Well-Known Member Licensed User Longtime User May 24, 2015 #7 Erel said: If you are implementing a server then you can use req.GetParameter. Click to expand... I just tried that and it worked perfect! Thanks heaps Upvote 0
Erel said: If you are implementing a server then you can use req.GetParameter. Click to expand... I just tried that and it worked perfect! Thanks heaps