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 help on string functions

Former Member
0 Likes
984

Hi,

I want to split contents of one character variable of length 15. say variable a stores string of length 15. i want to store first characters of a to variable b and rest of 11 characters in variable c.

i dont have any saperator there.

Please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
960


data: str type string,
 var1 type string,
var2 type string.



var1 = str+0(4).
var2 = str+4(11).


7 REPLIES 7
Read only

Former Member
0 Likes
960

Hi,

I supoose you can use the offset for this purpose.

Thanks & Regards

Read only

0 Likes
960

can you give me xample please.

i tryied following for geting b

b = a(4).

and it works fine but dont know how to get rest of contents in c

Read only

0 Likes
960

c = a+4(11)

Read only

Former Member
0 Likes
961


data: str type string,
 var1 type string,
var2 type string.



var1 = str+0(4).
var2 = str+4(11).


Read only

Former Member
0 Likes
960

b = a+0(4).

c = a+4(11).

Read only

Former Member
0 Likes
960

Hi,,


DATA: a(15) TYPE c VALUE 'abcdefgh',
      b TYPE char20,
      c TYPE char20.

b = a(1).
c = a+1.

Edited by: Sukriti Saha on Oct 23, 2008 4:38 PM

Read only

Former Member
0 Likes
960

Hi Sundeep,

Check the below code.


DATA : A TYPE CHAR20 VALUE 'ABCDEFGHIJKLMNO'.
DATA : B(4).
DATA : C(11).

B = A(4).
C=A+4(11).

regards

kumar M.