2009 Feb 05 11:37 AM
Dear all,
in one variable capture either 'ANSHUMAN' Or 'Anshuman' Or 'anshuman'.
i want to print as a Anshuman whether it is ANSHUMAN or Anshuman or anshuman
how can i do this
Plz help me
2009 Feb 05 11:40 AM
hi,
use Translate to lower case key word..
then using offset, get the first character and then translate it to upper case..
then concatenate into one variable...
Rgds.,
subash
Dear all,
in one variable capture either 'ANSHUMAN' Or 'Anshuman' Or 'anshuman'.
i want to print as a Anshuman whether it is ANSHUMAN or Anshuman or anshuman
how can i do this
Plz help me
2009 Feb 05 11:40 AM
hi,
use Translate to lower case key word..
then using offset, get the first character and then translate it to upper case..
then concatenate into one variable...
Rgds.,
subash
2009 Feb 05 11:42 AM
2009 Feb 05 11:46 AM
hi,
say var1 = 'ANSHUMAN' // to get length of var1 , use n =strnlen(var1).
translate var1 to lower case.. now var1 has anshuman.
then var2 = var1+0(1), now var2 it holds value 'a'.
var3 = var1+1(n), now var3 has nshuman.
now use translate var2 to upper case.
so var2 =A.
now concatenate var2 var3 into var1.
so now var1 has Anshuman.
Rgds.,
subash
2009 Feb 05 11:52 AM
Hi Anshuman Singh ,
Jusy copy this code,you will get the desired output.
I am not giving the exact answere but I am giving an Idea to achieve your problem..just do in this way...
data:
w_str(10) type c value 'ANSHUMAN',
w_str1(10) type c,
w_str2(1) type c.
w_str2 = w_str+0(1).
w_str1 = w_str+1(7).
translate w_str1 to lower case.
concatenate w_str2 w_str1 into w_str1.
write:/ w_str1.
Regards
Kiran
2009 Feb 05 11:58 AM
hi,
DATA:
w_char(20) TYPE c VALUE 'anshuman',
w_i TYPE i,
w_c TYPE c.
TRANSLATE w_char TO LOWER CASE.
w_c = w_char+0(1).
TRANSLATE w_c TO UPPER CASE.
w_i = strlen( w_char ).
CONCATENATE w_c w_char+1(w_i) INTO w_char.
WRITE:/ w_char.
this will work.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |