Link to home
Start Free TrialLog in
Avatar of rafaelrgl
rafaelrgl

asked on

get substring of an string

hi i have this string below

dim test as string = "javascript: test2(4622,4623)"

i want to get the first number inside the function test2, so the result would be 4622.

how can i accomplish this.
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Javascript solution:

<!DOCTYPE html>
<html>
<body>
<script>
var test = "4622,4623";
var measureit = test.substring(0, 4);
document.write(measureit);
</script>
</body>
</html>

Open in new window


vb.net version
Dim test As String = "4622,4623"
Response.Write(test.Substring(0, 4))

Open in new window

Avatar of Kimputer
Kimputer

Is it always a number? Fixed length? Always enclosed by the open bracket ( and comma?
Avatar of rafaelrgl

ASKER

is always an number but it~s not fixed size, can be 4 digits, can be 8 digits, but always have the comma after the first number and have the ( before start the number.
ASKER CERTIFIED SOLUTION
Avatar of n2fc
n2fc
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.  No response from anyone involved and doesn't appear to be a solution here.
Did he even TRY my solution?   It works!
Did he even TRY my solution?   It works!