Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

StringSplit

Usage

StringSplit["string"] splits "string" into a list of substrings separated by whitespace.
StringSplit["string", patt] splits into substrings separated by delimiters matching the string expression patt.
StringSplit["string", { ,  , ... }] splits at any of the  .
StringSplit["string", patt -> val] inserts val at the position of each delimiter.
StringSplit["string", { ->  , ... }] inserts  at the position of each delimiter  .
StringSplit["string", patt, n] splits into at most n substrings.
StringSplit[{ ,  , ... }, p] gives the list of results for each of the  .


Notes

• Example: StringSplit["a bb cc a"]LongRightArrow .
StringSplit[s] does not return the whitespace characters that delimit the substrings it returns.
• Whitespace includes any number of spaces, tabs and newlines.
• The string expression patt can contain any of the objects specified in the notes for StringExpression.
StringSplit[s] is equivalent to StringSplit[s, Whitespace].
• If s contains two adjacent delimiters, StringSplit considers there to be a zero-length substring "" between them.
StringSplit[s, patt] by default gives the list of substrings of s that occur between delimiters defined by patt; it does not include the delimiters themselves.
StringSplit[s, patt -> val] includes val at the position of each delimiter.
StringSplit["string", { ->  , ... ,  , ... }] includes  at the position of delimiters matching  , but omits delimiters matching  .
• By default, StringSplit[s, patt] drops zero-length substrings associated with delimiters that appear at the beginning or end of s.
StringSplit[s, patt, All] returns all substrings, including zero-length ones at the beginning or end.
• Setting the option IgnoreCase -> True makes StringSplit treat lower- and upper-case letters as equivalent.
StringSplit["string", RegularExpression["regex"]] splits at delimiters matching the specified regular expression.
• See Section 2.8.2.
• See also: Split, StringCases.
• New in Version 5.1.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: