07-26-2010, 10:04 PM
Hi,
Let me explain the below in detailed.
As we need the numeric value. We have to capture the first string i.e. string(0).
Please let me know if you still have any questions.
Let me explain the below in detailed.
Code:
txtstrng = "this is codeigo 86 testing numeric"
reqnum = Split(Split(txtstrng,"codeigo")(1),"testing")(0)
Let us look into the inner split first and then the outer split.
When you use split method using "codeigo", then it will breake into 2 strings.
Split(txtstrng,"codeigo")(1):
String(0) = "this is codeigo"
String(1)= "86 testing numeric"
So, Split(txtstrng,"codeigo")(1) = "86 testing numeric"
Now here again we are spliting the string with "testing"
Split(Split(txtstrng,"codeigo")(1),"testing")(0):
Split("86 testing numeric","testing")
When you use split method using "testing", then it will breake into 2 strings.
string(0)= "86 "
string(1)="testing numeric"
As we need the numeric value. We have to capture the first string i.e. string(0).
Please let me know if you still have any questions.
Thanks,
SUpputuri
SUpputuri