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

string operation

Former Member
0 Likes
732

Can anyone tell me how to extract the last three characters from a string?

Edited by: sudipto chakrabarty on Sep 25, 2008 6:40 AM

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
700

data v_len type p.

v_len = strlen( v_string ).

subtract 3 from v_len.

write: v_string+v_len(3).

5 REPLIES 5
Read only

Former Member
0 Likes
700

Hello


data: str1 type string,
str2 type string,
i type i.

str1 = '1234567890987654321'.

i = strlen( str1 ).
i = i - 3.
str2 = str1+i(3).
write str2.

Read only

former_member194669
Active Contributor
0 Likes
701

data v_len type p.

v_len = strlen( v_string ).

subtract 3 from v_len.

write: v_string+v_len(3).

Read only

Former Member
0 Likes
700
data : var1 type string.


parameters : p_var1 type string.

move p_var1 to var1.
write : var1+5(3).
Read only

Former Member
0 Likes
700

Hi use this code,

parameters:pp(60) type c .

data l type i.

data ll type i.

data cc(3) type c.

l = strlen( pp ).

ll = l - 3.

move pp+ll(3) to cc.

write : cc .

Read only

Former Member
0 Likes
700

Hi,

See F1 help for SHIFT Statement, you can use it as;

SHIFT text RIGHT DELETING TRAILING pattern.

Regards

Karthik D