From WikiChip
Difference between revisions of "string manipulation"
(Created page with "'''String manipulation''' (or '''string handling''') is a mechanism or a library feature of most programming languages that provides the capabilities of performing various...") |
|||
Line 1: | Line 1: | ||
− | '''String manipulation''' (or '''string handling''') is a mechanism or a library feature of most [[programming language]]s | + | '''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 language]]s. |
Typically, most programming languages provide a [[string]] [[data type]] that holds a sequence of characters. Such types often expose a set of [[function]]s and various other low-level functionality for manipulating the contained characters. | Typically, most programming languages provide a [[string]] [[data type]] that holds a sequence of characters. Such types often expose a set of [[function]]s and various other low-level functionality for manipulating the contained characters. | ||
− | + | == Common operations == | |
− | + | *'''[[Concatenation - string manipulation|Concatenation]]''' is the process of joining two [[strings]] together into a single string. For example "<code>race</code>" concatenated with "<code>car</code>" results in "<code>racecar</code>". | |
− | + | *'''[[Splitting - string manipulation|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 "<code>A B C</code>" could be split into three separate strings, ("<code>A</code>", "<code>B</code>", "<code>C</code>"), using the space character as a delimiter. | |
+ | *'''[[Substrings - string manipulation|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 "<code>apples</code>" is "<code>pp</code>". | ||
+ | *'''[[Case conversion - string manipulation|Case conversion]]''' is the process of converting a string into a specific case for example into all lowercase or [[titlecase]]. | ||
+ | *'''[[Searching - string manipulation|Searching]]''' is the process of searching for a specific pattern in a string. | ||
− | == | + | == In various languages == |
− | + | Most programming languages provide a built-in mechanism or library functions for manipulating strings. | |
− | == | + | {| id="mp-langs1" style="margin:4px 0 0 0; width:70%; background:none; border-spacing: 0px;" |
− | { | + | | class="MainPageBG" style="width:100%; vertical-align:top; color:#000;" | |
+ | {| id="mp-bottom" style="width:100%; vertical-align:top; " | ||
+ | | style="width:5%; font-size:95%; vertical-align: top;" | | ||
− | + | * [[String manipulation - ALGOL|ALGOL]] | |
− | + | * [[String manipulation - C Sharp|C Sharp]] | |
+ | * [[String handling - C|C]] | ||
+ | * [[String manipulation - C++|C++]] | ||
+ | * [[String manipulation - Delphi|Delphi]] | ||
− | = | + | | style="width:5%; font-size:95%; vertical-align:top;" | |
− | + | * [[String manipulation - Go|Go]] | |
+ | * [[String manipulation - Haskell|Haskell]] | ||
+ | * [[String manipulation - Java|Java]] | ||
+ | * [[String manipulation - JavaScript|JavaScript]] | ||
+ | * [[String manipulation - Lua|Lua]] | ||
− | = | + | | style="width:5%; font-size:95%; vertical-align:top;" | |
− | + | * [[String manipulation - mIRC|mIRC]] | |
+ | * [[String manipulation - PHP|PHP]] | ||
+ | * [[String manipulation - Python|Python]] | ||
+ | * [[String manipulation - Ruby|Ruby]] | ||
− | + | |} | |
− | + | |} | |
− | + | [[Category:string]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 01:28, 6 July 2014
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
- 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
Most programming languages provide a built-in mechanism or library functions for manipulating strings.
|