Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

escape character

Former Member
0 Kudos
157

Hello,

I need to build a function that replace the character "," by the string " ',' "

Example: Char1: 1,2,3

Char1 after conversion: 1','2','3

I m using the code:

DATA text TYPE string VALUE '1,2,3,4'.

REPLACE ALL OCCURRENCES OF REGEX ',' IN text WITH __?____.

I don´t know how to use the "escape character" so as to I can use the charater " ' " after of with.

Can someone help me ??

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos
106

Hi,

REPLACE all occurances of space IN your_string WITH 'Your_character' INTO lv_date

example code

data: string(10) type c,

string = '1212121212'.

translate string using '20'.

So in this case the value will now be '1010101010'

*Reward points

Regards

7 REPLIES 7

Former Member
0 Kudos
107

Hi,

REPLACE all occurances of space IN your_string WITH 'Your_character' INTO lv_date

example code

data: string(10) type c,

string = '1212121212'.

translate string using '20'.

So in this case the value will now be '1010101010'

*Reward points

Regards

0 Kudos
106

But I need to replace "," by " ',' " (3 characters) ...

I don´t understand how to do....

0 Kudos
106

data: replacetext type string .

replacetext = `','`  .
replace all occurrences of ',' in  <sourcevar> with replacetext .

please pay attendtion to

`','`

the sorround quote is actually the key (in your keyboard) to the left of number 1 .

Message was edited by:

Durairaj Athavan Raja

Former Member
0 Kudos
106

hi,

try like this

REPLACE ALL OCCURRENCES OF ',' WITH ' '" ,"'.

if helpful reward some points.

with regards,

suresh.

0 Kudos
106

It happens the next syntax error:

"." expected after '" ,"'.

Thanks.

santhosh_patil
Contributor
0 Kudos
106

Hi,

check this out

data: char(10) type c,

char1(10) type c.

data: len TYPE I.

char = 'a,b'.

replace ',' with <b>''','''</b> into char.

write char.

--Patil

Former Member
0 Kudos
106

Hi,

try like this

data : string(10) type c.

string = 'boy_&_girl'.

translate string using '_ '.

Write:/ string.

<b>*Reward points</b>

Regards