10-24-2006 5:23 PM
can anyone tell me how to use strlen with an example. I tried using it but getting an error saying strlen not defined.
10-24-2006 6:23 PM
Hi priyankaReddy
Note the space after begin parenthisis and before closinhg one in all the above examples.
10-24-2006 5:30 PM
data: v_len type i,
v_str type string value 'gggugik'.
v_len = strlen( v_str ).
write:/ v_len.
Regards,
ravi
10-24-2006 5:30 PM
Hi,
Check this example...
DATA: V_STR(4) VALUE '12'.
DATA: V_INT TYPE INT4.
V_INT = STRLEN( V_STR ).
WRITE: / V_INT.
Thanks,
Naren
10-24-2006 5:46 PM
Hi,
Please check this sample code.
DATA: INT TYPE I,
WORD1(20) VALUE '12345'.
WORD2(20).
WORD3(20) VALUE ' 4 '.
INT = STRLEN( WORD1 ). WRITE INT.
INT = STRLEN( WORD2 ). WRITE / INT.
INT = STRLEN( WORD3 ). WRITE / INT.
The results are 5 , 0, and 4 respectively.
Hope this will help.
Regards,
Ferry Lianto
10-24-2006 6:23 PM
Hi priyankaReddy
Note the space after begin parenthisis and before closinhg one in all the above examples.