‎2006 Jul 31 5:06 PM
I want to replace the unwanted characters in the string by space and i want the total count of the string excluding the spaces.
For example if a string contains 18 characters and i have passed only 10 characters and now i want the total length as 10 only.
Please mail to me at emadduri@gmail.com
Thanks & Regards,
MLN.
‎2006 Jul 31 5:13 PM
Hi,
if your string contains # as invalid character.(repeate same process for all invalid characters) use REPLACE to remove this character. after replacing with space use CONDENSE to remove spaces.now use STRLEN to get length of the string.
ex:
REPLACE ALL OCCURRENCES OF '#' IN string1 WITH space.
condense string1 with no-gaps.
x_length = strlen(string1).
Regards
Appana
*Reward Points for useful answers
‎2006 Jul 31 5:16 PM
first
replace the unwanted characters in the string
for this,
USE REPLACE command
and to shrink the string with leading/trailing spaces
use
CONDENSE V_STRING NO-GAPS.
THEN use STRLEN to calculate the length
v_integer = strlen( v_string ).
regards
srikanth
‎2006 Jul 31 6:03 PM
Hi narayana,
data: str1,str2 type string.
data: len1 type i.
replace all occurences of 'A' in str1 with space.
str2 = str1.
condense str2 no-gaps.
len1 = strlen (str2).
hope this helps u.
regards,
keerthi.
‎2006 Jul 31 6:48 PM