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


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

Details and Options

  • The string expression patt can contain any of the objects specified in the notes for StringExpression.
  • Setting the option IgnoreCase->True makes StringDelete treat lowercase and uppercase letters as equivalent.
  • StringDelete[patt][expr] is equivalent to StringDelete[expr,patt].
  • StringDelete[BioSequence["type","seq"],patt] removes cases of patt in the string "seq" yielding a biomolecular sequence. In this case, degenerate letters in patt are interpreted as wildcard patterns based on the type of biomolecular sequence. Use Verbatim["patt"] to match degenerate letters literally.
  • The documentation for BioSequence lists the degenerate letters supported by each type of biomolecular sequence.
  • If the biomolecular sequence operated upon by StringDelete is circular, wraparound matches are possible.


open allclose all

Basic Examples  (4)

Remove whitespace from a string:

Remove a specific character sequence:

Delete substrings matching a string pattern:

Use the operator form of StringDelete:

Scope  (4)

Remove corresponding substrings from a biomolecular sequence:

Delete codon-length subsequences in a DNA sequence:

StringDelete respects the degenerate letters and circularity of the provided BioSequence:

Use Verbatim to restrict degenerate letter matching to exact matches:

Options  (1)

IgnoreCase  (1)

Delete substrings regardless of case:

Wolfram Research (2015), StringDelete, Wolfram Language function, (updated 2020).


Wolfram Research (2015), StringDelete, Wolfram Language function, (updated 2020).


Wolfram Language. 2015. "StringDelete." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020.


Wolfram Language. (2015). StringDelete. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_stringdelete, author="Wolfram Research", title="{StringDelete}", year="2020", howpublished="\url{}", note=[Accessed: 18-June-2024 ]}


@online{reference.wolfram_2024_stringdelete, organization={Wolfram Research}, title={StringDelete}, year={2020}, url={}, note=[Accessed: 18-June-2024 ]}