‎2009 Dec 10 8:59 AM
hi all,
just help in replacing emty space ' 'with '.'
i used replace ' ' with '.' into b.
but its not replacing all empty spaces
b is hoding ====188 445 32
i need it like 188.445.32
plz help me
vamsee
‎2009 Dec 10 9:05 AM
‎2009 Dec 10 9:11 AM
Hello Vamsee,
I think you have to use the string literal ` ` instead of character literal ' '.
DATA v_str TYPE string.
v_str = '123 456 789'.
WRITE v_str.
REPLACE ALL OCCURRENCES OF ` ` IN v_str WITH '.'.
WRITE / v_str.BR,
Suhas
‎2009 Dec 10 9:15 AM
‎2009 Dec 10 9:21 AM
Or you can try
data: lv_string type string VALUE '188 445 32',
lv_str type string ,
lv_str1 type string ,
lv_str2 type string .
SPLIT lv_string at space into lv_str lv_str1 lv_str2.
CONCATENATE lv_str lv_str1 lv_str2 into lv_string SEPARATED BY '.'.
write lv_string.
‎2009 Dec 10 9:23 AM
Hello,
Can you please post your code here ? How you have defined the variables & how you are trying to replace the spaces.
BR,
Suhas
‎2009 Dec 10 9:32 AM
‎2009 Dec 10 9:14 AM
Hi, look at this example.
DATA: text TYPE string VALUE '-xx-'.
REPLACE ALL OCCURRENCES OF REGEX 'x*' IN text WITH 'a'.
After replacement, text contains value "a-aa-a".
Regards,
Nihad
Edited by: nihad omerbegovic on Dec 10, 2009 10:15 AM