Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of code/doc/String


Ignore:
Timestamp:
Sep 24, 2008, 5:51:59 PM (16 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/String

    v1 v2  
    44String defines several useful functions for string manipulation. The following list gives a short overview:
    55
    6  * '''strip('''''string* pointer''''')''':
    7  * '''getStripped('''''string''''')''':
     6 * '''strip('''''string* pointer''''')''': Removes all whitespaces from a string. See ''getStripped'' for examples.
     7 * '''getStripped('''''string''''')''': Removes all whitespaces and returns the modified string.
     8  * Example: getStripped(" test abc\tabc test\nThis is a newline! ") = "testabcabctestThisisanewline!"
    89
    9  * '''removeTrailingWhitespaces('''''string''''')''':
     10 * '''removeTrailingWhitespaces('''''string''''')''': Removes trailing whitespace and returns the modified string.
     11  * Example:
     12{{{
     13#!html
     14<span style="white-space:pre;">removeTrailingWhitespaces("    test      abc    ") = "test      abc"</span>
     15}}}
    1016
    11  * '''getNextQuote('''''string''''', '''''start''''')''':
    12  * '''isBetweenQuotes('''''string''''', '''''position''''')''':
     17 * '''getNextQuote('''''string''''', '''''start''''')''': Returns the position of the next quote in the string, starting with start.
     18  * Examples:
     19   * getNextQuote("123\"567\"9", 0) = 4
     20   * getNextQuote("123\"567\"9", 4) = 4
     21   * getNextQuote("123\"567\"9", 6) = 8
     22   * getNextQuote("123\"567\"9", 9) = std::npos
     23 * '''isBetweenQuotes('''''string''''', '''''position''''')''': Returns true if ''position'' is between two quotes.
     24  * Examples:
     25   * isBetweenQuotes("123\"567\"9", 1) = false
     26   * isBetweenQuotes("123\"567\"9", 4) = false
     27   * isBetweenQuotes("123\"567\"9", 5) = true
     28   * isBetweenQuotes("123\"567\"9", 8) = false
     29   * isBetweenQuotes("123\"567\"9", 9) = false
    1330
    14  * '''hasStringBetweenQuotes('''''string''''')''':
    15  * '''getStringBetweenQuotes('''''string''''')''':
     31 * '''hasStringBetweenQuotes('''''string''''')''': Returns true if the string contains something like '..."between quotes"...'.
     32  * Examples:
     33   * hasStringBetweenQuotes("test") = false
     34   * hasStringBetweenQuotes("test\"abc") = false
     35   * hasStringBetweenQuotes("test\"abc\"") = true
     36 * '''getStringBetweenQuotes('''''string''''')''': If the string contains something like '..."between quotes"...' then 'between quotes' gets returned (without quotes).
     37  * Examples:
     38   * hasStringBetweenQuotes("test") = ""
     39   * hasStringBetweenQuotes("test\"abc") = ""
     40   * hasStringBetweenQuotes("test\"abc\"") = "abc"
    1641
    17  * '''stripEnclosingQuotes('''''string''''')''':
    18  * '''stripEnclosingBraces('''''string''''')''':
     42 * '''stripEnclosingQuotes('''''string''''')''': Removes enclosing quotes if available (including whitespaces at the outside of the quotes).
     43  * Examples:
     44   * stripEnclosingQuotes(" \"hello!\" ") = "hello!"
     45   * stripEnclosingQuotes(" \"hello! ") = " \"hello! "
     46 * '''stripEnclosingBraces('''''string''''')''': Removes enclosing {braces} (braces must be exactly on the beginning and the end of the string).
     47  * Examples:
     48   * stripEnclosingBraces("{test}") = "test"
     49   * stripEnclosingBraces(" {test}") = " {test}"
     50   * stripEnclosingBraces("{ test }") = " test "
    1951
    2052 * '''isEmpty('''''string''''')''':