Useful String Operation


Substring with Offset and length


DATA  result TYPE string.

result = substring( val = ‘ABCDEFGH’ off = 2 len = 3 ).

Write :/ result



OUTPUT:   CDE


Substring From


DATA  result TYPE string.

result = substring_from( val = ‘ABCDEFGH’ sub = ‘CD’ ).

Write :/ result



OUTPUT:   CDEFGH



Substring After


DATA  result TYPE string.

result = substring_after( val = ‘ABCDEFGH’ sub = ‘CD’ ). 

Write :/ result



OUTPUT:   EFGH


Substring Before


DATA  result TYPE string.

result = substring_brfore( val = ‘ABCDEFGH’ sub = ‘CD’ ). 

Write :/ result



OUTPUT:   AB


Substring To


DATA  result TYPE string.

result = substring_to( val = ‘ABCDEFGH’ sub = ‘CD’ ). 

Write :/ result



OUTPUT:   ABCD


 

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s