1. How to exclude separation symbols from string?
- Posted by SnakeCharmer Sep 18, 2012
- 1185 views
Example: "I am Putin Worshipper" --> "IamPutinWorshipper"
find_replace(' ', String, '') -- dosn't work
2. Re: How to exclude separation symbols from string?
- Posted by Lnettnay Sep 18, 2012
- 1157 views
SnakeCharmer said...
Example: "I am Putin Worshipper" --> "IamPutinWorshipper"
find_replace(' ', String, '') -- dosn't work
Hi SnakeCharmer, Try
include std/sequence.e sequence oldstring = "I am Putin Worshipper" sequence newstring newstring = remove_all(' ', oldstring) printf(1, "%s\n", {newstring})
3. Re: How to exclude separation symbols from string?
- Posted by Insolor Sep 19, 2012
- 1059 views
SnakeCharmer said...
Example: "I am Putin Worshipper" --> "IamPutinWorshipper"
find_replace(' ', String, '') -- dosn't work
'' is not valid character, so in order to remove some characters you need to use remove_all() function instead, as Lnettnay suggested. In case you need to remove some substring (or replace it with another one) you can use match_replace() func:
puts(1,match_replace(" ", "I am Putin Worshipper", "")&'\n') -- "" is valid character string, so it works fine puts(1,match_replace("Putin", "I am Putin Worshipper", "Medvedev")&'\n') -- works too
4. Re: How to exclude separation symbols from string?
- Posted by SnakeCharmer Sep 20, 2012
- 1042 views
Thanks!