From WikiChip
Difference between revisions of "string manipulation"

m (Inject moved page String manipulation to string manipulation)
m
 
Line 19: Line 19:
 
| style="width:5%; font-size:95%; vertical-align: top;" |
 
| style="width:5%; font-size:95%; vertical-align: top;" |
  
* [[String manipulation - ALGOL|ALGOL]]
+
* [[algol/string manipulation|ALGOL]]
* [[String manipulation - C Sharp|C Sharp]]
+
* [[c sharp/string manipulation|C Sharp]]
* [[String handling - C|C]]
+
* {{C|string handling|C}}
* [[String manipulation - C++|C++]]
+
* [[c++/string manipulation|C++]]
* [[String manipulation - Delphi|Delphi]]
+
* [[delphi/string manipulation|Delphi]]
  
 
| style="width:5%; font-size:95%; vertical-align:top;" |
 
| style="width:5%; font-size:95%; vertical-align:top;" |
* [[String manipulation - Go|Go]]
+
* [[go/string manipulation|Go]]
* [[String manipulation - Haskell|Haskell]]
+
* [[haskell/string manipulation|Haskell]]
* [[String manipulation - Java|Java]]
+
* [[java/string manipulation|Java]]
* [[String manipulation - JavaScript|JavaScript]]
+
* [[javascript/string manipulation|JavaScript]]
* [[String manipulation - Lua|Lua]]
+
* [[lua/string manipulation|Lua]]
  
 
| style="width:5%; font-size:95%; vertical-align:top;" |
 
| style="width:5%; font-size:95%; vertical-align:top;" |
* [[String manipulation - mIRC|mIRC]]
+
* {{mIRC|string manipulation|mIRC}}
* [[String manipulation - PHP|PHP]]
+
* [[php/string manipulation|PHP]]
* [[String manipulation - Python|Python]]
+
* [[python/string manipulation|Python]]
* [[String manipulation - Ruby|Ruby]]
+
* [[ruby/string manipulation|Ruby]]
  
 
|}
 
|}

Latest revision as of 11:08, 4 January 2015

String manipulation (or string handling) is the process of changing, parsing, splicing, pasting, or analyzing strings. String manipulation typically comes as a mechanism or a library feature of in most programming languages.

Typically, most programming languages provide a string data type that holds a sequence of characters. Such types often expose a set of functions and various other low-level functionality for manipulating the contained characters.

Common operations[edit]

  • Concatenation is the process of joining two strings together into a single string. For example "race" concatenated with "car" results in "racecar".
  • Splitting is the process of breaking down a string into multiple strings according to a certain delimiter or rule (e.g. regex pattern). For example "A B C" could be split into three separate strings, ("A", "B", "C"), using the space character as a delimiter.
  • Substrings is the process of extracting a portion of the string from a bigger string. Such operations typically involve a starting offset and a length. For example, one possible substring of "apples" is "pp".
  • Case conversion is the process of converting a string into a specific case for example into all lowercase or titlecase.
  • Searching is the process of searching for a specific pattern in a string.

In various languages[edit]

Most programming languages provide a built-in mechanism or library functions for manipulating strings.