2008 Dec 05 10:22 AM
Hi All,
Can anybody tell me how to find that : how many times an particular character occurs in the string.
for eg.
if my string is : HI~this is the FirstLogin~.
i want to find the number of time that ~ character occurs in string.
please give me the solution.
thanks in advance.
vinod.
2008 Dec 05 10:23 AM
Hi All,
Can anybody tell me how to find that : how many times an particular character occurs in the string.
for eg.
if my string is : HI~this is the FirstLogin~.
i want to find the number of time that ~ character occurs in string.
please give me the solution.
thanks in advance.
vinod.
2008 Dec 05 10:23 AM
Hello,
Use CA -> Contains any operator.
if wa_temp CA '~'.
< >
endif.
Thanks,
Jayant
2008 Dec 05 10:23 AM
2008 Dec 05 10:25 AM
Hi vinod,
Use the following code:
IF v_string CS '~'.
WRITE:/1 'Yes'.
ELSE.
WRITE:/1 'No'.
ENDIF.
Regards,
Nitin.
2008 Dec 05 10:26 AM
SEARCH in SCN by Find Character in string you will get so many posts like these.
[https://forums.sdn.sap.com/click.jspa?searchID=19575500&messageID=6056291]
2008 Dec 05 10:38 AM
Hi
data lv_string type string.
data ncount type i.
find ALL OCCURRENCES OF '~' in lv_string MATCH COUNT ncount.
ncount will have number of '~'.
Regards,
Rohit
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |