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

Need to remove bracket

Former Member
0 Likes
1,342

Hi All,

My String is Str =" Anshul((Rawat))"

I need to remove each of the one bracket..o/p should be like "Anshul(Rawat).

Plz help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
961

Hello


data: str(20).
Str = ' Anshul((Rawat))'.
REPLACE '((' WITH '(' INTO str.
REPLACE '))' WITH ')' INTO str.
write str.

5 REPLIES 5
Read only

Former Member
0 Likes
962

Hello


data: str(20).
Str = ' Anshul((Rawat))'.
REPLACE '((' WITH '(' INTO str.
REPLACE '))' WITH ')' INTO str.
write str.

Read only

Former Member
0 Likes
961

Hi Dzed ..

Thanks a lot...Its done...

Regards

Anshul

Read only

Former Member
0 Likes
961

Hi Dzed,

If i use double brackets more than one time, it is not working properly.

like "Anshuk((Rawat))Hello))".

It replaces only first double bracket once and gives the output as" Anshul(Rawat)Hello))"

Read only

0 Likes
961

Hi,

Use REPLACE ALL OCCURENCES OF '((' WITH '(' INTO str.

REPLACE ALL OCCURENCES OF '))' WITH ')' INTO str.

Regards,

Ganga

Read only

Former Member
0 Likes
961

Hi,

you can achieve this in 2 means.

1. check the field(variable) from which you are displaying this to the output.

.Str =" Anshul((Rawat))"

then check out for the first occurrence of '(' and also for the last occurrence of ')'.

then delete those two things.

after this your output looks like Anshul(Rawat).

2.Check out for the string length and use offset positions to remove the special characters.

Thanks & regards,

Sasi Kanth.