on 09-27-2007 9:56 AM
Hi experts,
Can u please explain the following standard Text functions with some examples,
Indexof (2 input parameter)
Indexof(3 input parameter)
Lastindex of(2 input parameter)
Lastindexof(3 input parameter)
I gone thru the sap help link and worked with simple example. but still i have some doubt with 2&3 parameters and Lastindexof and indexof.
also suggest me at which time we can use these functions.
Thanks in advance
>>Indexof (2 input parameter)
Returns the positon where the second string is found in the first string.
Eg: santhosh & a = 1.
santhosh & s = 0.
>>Indexof(3 input parameter)
Returns the positon where the second string is found in the first string but the search starts from the specified position.
Eg: santhosh & s & 0 = 0 but
santhosh & s & 3 = 6 bcz after the 3rd pos s occurs at 6th pos.
>>Lastindex of(2 input parameter)
Eg: santhosh & s = 6.
>>Lastindexof(3 input parameter)
santhosh & s & 3 = 6
Lastindex is same as index except it searches for the last occurance
Regards
San
Message was edited by:
Santhosh Kumar V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
IndexOf (2) will search for the string specified in second parameter in the string specified in first parameter and returns the index of the first occurence.
IndexOf (3) it works in the sameway as above but will not start searching from the beginning and will search from the index specified in the parameter. If you specify zero in the parameter literally there is no difference in both of them as both search from the beginning.
lastIndexOf also works in the same way as explained above except that it returns the last occurence instead of first.
Hope i am clear.
Regards,
Sudheer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.