Message Boards Message Boards

0
|
2514 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

StringReplace help?

Posted 10 years ago
POSTED BY: Miguel Olivo-V
2 Replies

One way is to use FixedPoint with a pure function as in:

FixedPoint[
 StringReplace[#, {Whitespace ~~ "IN" ~~ (Whitespace | EndOfString) ->
      " ", Whitespace ~~ "CO" ~~ (Whitespace | EndOfString) -> 
     " "}] &, "A CO IN"]
POSTED BY: David Reiss
Posted 10 years ago

Thanks a lot. Excellent answer as always, David.

POSTED BY: Miguel Olivo-V
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract