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

Last character of string..

Former Member
0 Likes
4,891

<<By SEARCHING>>

Hello Gurus,

How can I find the last character of a string ?

Pleas help.

Regards,

Jainam.

Edited by: Matt on Sep 30, 2009 9:45 PM

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
1,540

Hi, Shah

Please SEARCH Before Posting BASIC Question

Reported...

Faisal

8 REPLIES 8
Read only

faisalatsap
Active Contributor
0 Likes
1,541

Hi, Shah

Please SEARCH Before Posting BASIC Question

Reported...

Faisal

Read only

Former Member
0 Likes
1,540

<<stop it>>

Hi,

Have a look at this,


data: var type string,
         len type i,
         var1 type i.

var = 'abc1234f'.

len = strlen( var ).
var1 = len - 1.

write: 'the last character is', var+var1(1).

Regards,

Vikranth

Edited by: Matt on Sep 30, 2009 9:46 PM

Read only

0 Likes
1,540

Sorry, Vikranth

Please don't mind Reply to BASIC Question is also against the Rules Please Correct me if wrong

Faisal

Read only

0 Likes
1,540

This message was moderated.

Read only

0 Likes
1,540

Hello Jainam ,

To be honest its a bit of a basic question which can be easily found by searching in SCN. Generally even i remind those who post basic questions to search in SCN its just that i replied to you on-the-fly. Faisal is right. Its just to ensure that people search in SCN before posting. Just make sure you do a through search in SCN when posting in future.

Regards,

Vikranth

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,540

Hello Vikranth,

If you agree with the fact that it is a basic question why bother answering it? This forum will be a better place if we all make it a point of not answering redundant questions.

I know that we have mods cleaning up this rubbish, but unless we make a committment to stick to the Forum Rules it is hard for them as well.

@OP: Please dont make such noise. The forum rules are not decided by Faisal but by our very Mods so that we keep this ABAP Forum a very clean place.

Enough lecture for tonight !!

Suhas

Read only

matt
Active Contributor
0 Likes
1,540

Yes. And we deel quite robustly with people who violate those rules. Please see my comments at the top of each post.

Faisal. Respect.

matt

Read only

Former Member
0 Likes
1,540

<<don't answer FAQs>>

Hi

Try this

data : str type string,

char.

data : len type i,

len1 type i.

len = strlen( str ).

len1 = len - 1.

char = str+len1(1).

write : /10 char.

Regards

Krishna

Edited by: Matt on Sep 30, 2009 9:53 PM