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

regarding the string

rohit_kaikala
Participant
0 Likes
690

Hi All,

I have a string with 9 character.

Now I need to delete the 5th character and make it into 8 character string.

Can u plz tel me the exact procedure?

Thank u and Best Regards,

Rohit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
662

Hi,

Try in this way


DATA: value1 TYPE string VALUE 'abcdefghi', 
           value2 TYPE string.

CONCATENATE value1+0(4) value1+5(4) INTO value2.
WRITE value2.

Cheers,

Kothand

4 REPLIES 4
Read only

Former Member
0 Likes
662

Hi Rohit ,

You mean , want to move the 5th character to 8th character?

If so , then

v_part8 = v_string+0(7).

v_string0(7) = v_string0(5).

v_string+0(5) = v_part8.

Allot points if usefull.

Read only

Former Member
0 Likes
663

Hi,

Try in this way


DATA: value1 TYPE string VALUE 'abcdefghi', 
           value2 TYPE string.

CONCATENATE value1+0(4) value1+5(4) INTO value2.
WRITE value2.

Cheers,

Kothand

Read only

Former Member
0 Likes
662

Hi,

Try this

Concatenate str0(4) str5(4) into str.

Regards,

Surinder

Read only

Former Member
0 Likes
662

Hello


data: str(9),
     s(1).
s = str+4(1).
str+4(1) = ''.
str+7(1) = s.
condense str.
write str.