‎2005 Dec 01 4:29 PM
Hi,
i need to remove all spaces in a string immediately after ',' but not all .
for eg :
name = first, middle last
after processing it should appear as
first,middle last.
replace ', ' with ',' into name ...doesn't seems to be working. is there any way to do that in a single statement.
your help would be appreciated.
Thanks,
Kranthi.
Message was edited by: kranthi kumar
‎2005 Dec 01 5:01 PM
Condense is not working...but i need to remove spaces Immediately after ','
Thanks,
Kranthi.
Message was edited by: kranthi kumar
‎2005 Dec 01 4:38 PM
it worked for me... see below code
data : name(40).
name = 'first, middle last'.
replace ', ' with ',' into name.
write : name.
‎2005 Dec 01 4:43 PM
Hi Kranthi,
try this....
REPLACE FIRST OCCURRENCE OF '' IN name WITH ','.
REPLACE FIRST OCCURRENCE OF ',,' IN name WITH ','.
reagrds
vijay
‎2005 Dec 01 4:44 PM
data: l_str type string.
l_str = 'First , Middle Last'.
write:/ l_str.
replace ' , ' with ',' into l_str.
write:/ l_str.
Output:
First , Middle Last
First,Middle Last
<u>worked for me too.</u>
‎2005 Dec 01 4:44 PM
‎2005 Dec 01 4:47 PM
Thanks all for your response.
however, if there is MORE than one SPACE after COMMA it doesn't work ,could you let me know more feasible solution
Thanks,
Kranthi.
‎2005 Dec 01 4:52 PM
Ok
I think You requirement will not allow you to use condense.
so i will find some thing...
vijay
‎2005 Dec 01 4:54 PM
‎2005 Dec 01 5:01 PM
Condense is not working...but i need to remove spaces Immediately after ','
Thanks,
Kranthi.
Message was edited by: kranthi kumar
‎2005 Dec 01 5:04 PM
CONDENSE NO-GAPS will remove all spaces, but just CONDENSE will remove all but one spaces.
‎2005 Dec 01 5:06 PM
data : w_str1(40),
w_str2 like name.
split name at ',' into w_str1 w_str2.
shift w_str2 left deleting leading space.
concatenate w_str1 ',' w_str2 into name.
‎2005 Dec 01 5:14 PM
Hi Kranthi,
Try to use the below code.
data: test(15),
test1(10),
test2(10).
test = 'first, last'.
split test at ',' into test1 test2.
condense test2.
concatenate test1 ',' test2 into test.
write:/ test .