String Search

Hi,

I have a string which comprises of 123/6.3/643/02. The last two digits could go into the 1000’s. What I am trying to do is get the number after the last ‘/’ and store it in a string. the length of the whole string could be different (i.e. it could be 12/6.3/21/2001)

Does anyone have any ideas as how to get the last digits after the last ‘/’.

Thanks for any help

F1 Help.

Subject: String Search

just do @Word(fieldname;"/"4)

Subject: RE: String Search

Search help for the Split function if you are in LS. I think @explode is the formula equivalent. Split returns a variant.

So in this example:

dim myString as string

dim stringArray as variant

myString = ‘31/6.5/20/2001’

stringArray = Split(myString, “/”)

forall stops in stringArray

messagebox stops,“Array positions”

end forall

would pop up the following:

31

6.5

20

2001

HTH

Shawn

Subject: RE: String Search

If you are not sure how many / are there in the string you can use@RightBack( stringToSearch ; “/” )

Subject: RE: String Search

Thanks for your very fast response,

I am trying to do this within a LotusScript agent and wondered if you could supply an example of how to use the equivilent LS example strToken.

Thanks

F1Help

Subject: RE: String Search

Thanks,

I found an example of how to use the LS equiv in the help.

Sub Initialize

Dim delim As String

Dim ret As String

Dim teststr as string

teststr = “Art, Business, Computers, Education”

delim = ", "

ret = strtoken(teststr, delim,3)

Print ret

End Sub

'OUTPUT

'Computers

I think This will do the trick,

Thanks for your help

F1 Help

Subject: RE: String Search

Quickest way of doing that is to just use split, as was mentioned earlier:

dim arrResult as variant

arrResult = split(“Art, Business, Computers, Education”, “,”)

print trim(arrResult(2)) '//arrays are 0 based

'Computers

if you just want the last, do:

print strRightBack(“Art, Business, Computers, Education”, “,”)

'Education

Bjorn