Application Development and Automation 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: 
Read only

Remove a particular character from a string

Former Member
0 Likes
6,899

Dear Friends,

I have a requirement where I have to remove all the ( from a string.

My string is like this 'amitsharmav((((sdf(()]]hfg]]]'. Is it possible than please specify the ABAP command or the function module name.

Thanks & Regards

Amit Sharma

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,513

Use,

REPLACE ALL OCCURENCES OF '(' in string1 with space.

condence string1.

4 REPLIES 4
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
6,513

Use REPLACE

[ FIRST OCCURRENCE OF | ALL OCCURRENCES OF ]

[ SUBSTRING ] old

IN [ SECTION OFFSET off LENGTH len OF ] text

WITH new.

    • taken form abaphelp .

Read only

Former Member
0 Likes
6,513

Hello


data: str1(50),
      str2(50).

str1 = 'amitsharmav((((sdf(()]]hfg]]]'.
str2 = '( ) [ ] '.
TRANSLATE str1 USING str2.
condense str1.

write str1.

Read only

Former Member
0 Likes
6,514

Use,

REPLACE ALL OCCURENCES OF '(' in string1 with space.

condence string1.

Read only

prince_isaac
Active Participant
0 Likes
6,513

Hie Amit

Have a look at the report DEMO_REGEX_TOY.

regards

Isaac Prince