2007 Jun 14 4:46 PM
hi,
i want to split a string with char and int, then string are concanating with '+'.
e.g. string = " text1 text2 text3 5"
result = text1text2text3
int = 5
How can i do it?
thx
shuo
hi,
i want to split a string with char and int, then string are concanating with '+'.
e.g. string = " text1 text2 text3 5"
result = text1text2text3
int = 5
How can i do it?
thx
shuo
2007 Jun 14 5:03 PM
Shuo,
Please see the code below
DATA itab TYPE TABLE OF string WITH HEADER LINE.
DATA : str TYPE string VALUE 'text111 text222 tex333 4444',
opstr type string.
DATA : int TYPE i.
SPLIT str AT space INTO TABLE itab.
LOOP AT itab.
IF NOT ( itab CN '0123456789' ).
int = itab.
ELSE.
CONCATENATE opstr itab INTO opstr separated by space.
ENDIF.
ENDLOOP.
WRITE 😕 'String', opstr.
WRITE 😕 'Integer', int.
<i>Reward if you find it useful</i>
Regards,
Sail
2007 Jun 14 5:27 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |