StringDelete

StringDelete["string",patt]

yields the string obtained by deleting from string all occurrences of anything matching the string pattern patt.

StringDelete[patt]

represents an operator form of StringDelete that can be applied to an expression.

Details and Options

Examples

open allclose all

Basic Examples  (4)

Remove whitespace from a string:

In[1]:=
Click for copyable input
Out[1]=

Remove a specific character sequence:

In[1]:=
Click for copyable input
Out[1]=

Delete substrings matching a string pattern:

In[1]:=
Click for copyable input
Out[1]=

Use the operator form of StringDelete:

In[1]:=
Click for copyable input
Out[1]=

Options  (1)

See Also

StringReplace  StringTrim  StringContainsQ  DeleteStopwords  DeleteCases

Introduced in 2015
(10.1)