fox
Junior Member
Posts: 52
|
Post by fox on Jan 7, 2019 16:46:45 GMT -5
Hi all. I would like to know if there is an easy way (command) to remove all spaces of a string. Example: "I am writing to Forum" > "IamwritingtoForum". Thanks a lot for any suggestion and bye. fox
|
|
|
Post by metro on Jan 7, 2019 17:28:37 GMT -5
this works for me
line$="I am writing to Forum" print strip$(line$) ' ----------------------------------------- ' strip space ' ----------------------------------------- FUNCTION strip$(str$) strip$ = "" for i = 1 to len(str$) a$ = MID$(str$,i,1) if a$ = " " then a$="" end if strip$ = strip$ + a$ next i END FUNCTION
|
|
fox
Junior Member
Posts: 52
|
Post by fox on Jan 7, 2019 21:41:06 GMT -5
Thanks a lot, metro. Surely a good and easy way. Bye fox
|
|
|
Post by tsh73 on Jan 8, 2019 4:58:40 GMT -5
There is build-in function since LB 4.5.0:
line$="I am writing to Forum" 'native way (since LB 4.5.0) print REMCHAR$(line$, " ")
|
|
|
Post by metro on Jan 8, 2019 5:32:46 GMT -5
Thanks Anatoly I think I need to read the help file more often
|
|
fox
Junior Member
Posts: 52
|
Post by fox on Jan 8, 2019 5:51:08 GMT -5
Thanks a lot, tsh73. Your suggestion is precious for me. Bye fox
|
|