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

Add sign to string

Former Member
0 Likes
709

Hi,

i have strings like :

1000115

and i wont to turn it to 1000-115

or i have 100042

i wont 1000-042

what is the simple way to do that?

Regards

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
654

hi,

something like:

CONCATENATE string(4) string+4(3) INTO .... SEPARATED BY '-'.

of course, this can vary, depending on the exact rule you need

hope this helps

ec

Hi,

i have strings like :

1000115

and i wont to turn it to 1000-115

or i have 100042

i wont 1000-042

what is the simple way to do that?

Regards

4 REPLIES 4
Read only

JozsefSzikszai
Active Contributor
0 Likes
655

hi,

something like:

CONCATENATE string(4) string+4(3) INTO .... SEPARATED BY '-'.

of course, this can vary, depending on the exact rule you need

hope this helps

ec

Read only

peter_ruiz2
Active Contributor
0 Likes
654

hi,

use concatenate.

ex.


DATA: 
v_value(7) type c value '1000115',
v_temp(8) type c.

concatenate v_value(4) '-' v_value+4 int v_temp.

regards,

Peter

Read only

Former Member
0 Likes
654

concatenate v_string0(4) '-' v_string4(3) into v_string1.

write 😕 v_string1.

Read only

Former Member
0 Likes
654

hiii

you can do it by using offset values like follows

data:

string1 = w_final+4.

string2 = w_final+4(3).

CONCATENATE string1 string2 INTO string SEPARATED BY '-'.

regards

twinkal