function 2: string-replace
string-replace:
description:
string-replace(source-sp, dest-ket) input-seq
For all kets in source-sp, replace with dest-ket in input-seq
examples:
string-replace(|sad>, |happy>) (|a> . |sad> . |fellow>)
|a> . |happy> . |fellow>
-- remove " chars operator:
remove-quotes (*) #=> string-replace(|">, |>) |__self>
-- now put it to use:
remove-quotes |text: "some text">
|text: some text>
-- remove punctuation chars:
-- :;.,!?$-"'
remove-punctuation (*) #=> string-replace(split |:;.,!?$-"'>, |>) |__self>
-- now put it to use:
remove-punctuation |some !$??..,:"text>
|some text>
see also:
char-replace
Home