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: 

getting character of a string by position

former_member699400
Active Participant
0 Kudos

Hi!

is there any standart function to check a character of a string by position?

For example, I need to check is first character is "A" and second character is "B".

Do I need to process the string manually or is it a standart function for this?

Will reward,

M.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

u can check using the following syntax:

data: str type string value 'ABCD'.

check str+0(1) = 'A'.

regards,

Navneeth K.

2 REPLIES 2

Former Member
0 Kudos

hi,

u can check using the following syntax:

data: str type string value 'ABCD'.

check str+0(1) = 'A'.

regards,

Navneeth K.

gopi_narendra
Active Contributor
0 Kudos

You need to use the OFFSET


data : name(10) type c.
Name = 'GopiNarendra'.
write : name+0(3).
" Output
Gop

Writes the first three characters

Regards

Gopi