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

Strings

Former Member
0 Likes
454

DATA text TYPE string VALUE `I know you know`.

SHIFT text RIGHT DELETING TRAILING 'no kw'.

O/P : " I know you"

Can You Explain This....How?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
422

HI,

this statement will shift the string char by char for the length of comparing string number of times.if the char each time shifting right is present in the pattern it will delete and continue. else it will stop.

in this example.length of comparing string('no kw') = 4(including space)

1st right shift char is 'W' it is there in 'no kw' so it will delete and continue.

2nd right shift char is 'O' it is there in 'no kw' so it will delete and continue.

3rd right shift char is 'N' it is there in 'no kw' so it will delete and continue.

4th right shift char is 'K' it is there in 'no kw' so it will delete and continue.

5th right shift char is ' ' it is there in 'no kw' so it will delete and continue.

6th right shift char is 'U' it is not there in 'no kw' so it will stop.

rgds,

bharat.

2 REPLIES 2
Read only

Former Member
0 Likes
422

Hi,

DATA text TYPE string VALUE `I know you know`.

SHIFT text RIGHT DELETING TRAILING 'ownk'.

write:/ text.

It's deleting the word containing of the alphabets k,n,o,w.

Even try for the above example.

Bye,

KC

Read only

Former Member
0 Likes
423

HI,

this statement will shift the string char by char for the length of comparing string number of times.if the char each time shifting right is present in the pattern it will delete and continue. else it will stop.

in this example.length of comparing string('no kw') = 4(including space)

1st right shift char is 'W' it is there in 'no kw' so it will delete and continue.

2nd right shift char is 'O' it is there in 'no kw' so it will delete and continue.

3rd right shift char is 'N' it is there in 'no kw' so it will delete and continue.

4th right shift char is 'K' it is there in 'no kw' so it will delete and continue.

5th right shift char is ' ' it is there in 'no kw' so it will delete and continue.

6th right shift char is 'U' it is not there in 'no kw' so it will stop.

rgds,

bharat.