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: 

regarding the string

rohit_kaikala
Participant
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Try this

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

Regards,

Surinder

Former Member
0 Kudos

Hello


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