This class specializes parent class String to allow reduction of the length of the represented string by cutting characters from the front or the end. Such reduction does not affect the character array represented, but only its representation by instances of this type.
In other words, the difference to base class String is, that this type allows to increase the pointer to the character array's start and to decrease its stored length. In all other respects, this class has the same lightweight nature and performance as its base. Furthermore, the flexible TMP mechanics for seamless construction is exposed from the base class and likewise available.
Like base class String , the class can not, and therefore does not, verify that the underlying buffer is (still) properly allocated and contains valid data. It is up to the user of this class to make sure the buffer stays intact until any referencing object of this type is disposed.
TChar | The character type. Alias names for specializations of this class using character types character , nchar , wchar , xchar , complementChar and strangeChar are provided in namespace alib with type definitions Substring , NSubstring , WSubstring , XSubstring , ComplementSubstring and StrangeSubstring . |
Definition at line 48 of file substring.hpp.
#include <substring.hpp>
Public Method Index: | |
TSubstring () | |
TSubstring (const TString< TChar > &src) | |
TSubstring & | Clear () |
template<typename TIntegral > | |
bool | ConsumeBin (TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<bool TCheck = true, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
TChar | ConsumeChar () |
template<lang::Case TSensitivity = lang::Case::Sensitive, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
bool | ConsumeChar (TChar consumable) |
template<bool TCheck = true, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
TChar | ConsumeCharFromEnd () |
template<lang::Case TSensitivity = lang::Case::Sensitive, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
bool | ConsumeCharFromEnd (TChar consumable) |
template<bool TCheck = true, lang::CurrentData TTargetData = lang::CurrentData::Clear> | |
integer | ConsumeChars (integer regionLength, TAString< TChar > &target, integer separatorWidth=0) |
template<bool TCheck = true> | |
integer | ConsumeChars (integer regionLength, TString< TChar > &target, integer separatorWidth=0) |
template<bool TCheck = true> | |
integer | ConsumeChars (integer regionLength, TSubstring *target=nullptr) |
template<bool TCheck = true, lang::CurrentData TTargetData = lang::CurrentData::Clear> | |
integer | ConsumeCharsFromEnd (integer regionLength, AString &target, integer separatorWidth=0) |
template<bool TCheck = true> | |
integer | ConsumeCharsFromEnd (integer regionLength, TSubstring *target=nullptr) |
template<typename TIntegral > | |
bool | ConsumeDec (TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<typename TIntegral > | |
bool | ConsumeDecDigits (TIntegral &result) |
template<lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
TString< TChar > | ConsumeField (TChar startChar, TChar endChar) |
ALIB_API bool | ConsumeFloat (double &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<typename TIntegral > | |
bool | ConsumeHex (TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<typename TIntegral > | |
bool | ConsumeInt (TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<typename TIntegral > | |
bool | ConsumeOct (TIntegral &result, TNumberFormat< TChar > *numberFormat=nullptr) |
template<lang::Case TSensitivity = lang::Case::Ignore, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
integer | ConsumePartOf (const TString< TChar > &consumable, int minChars=1) |
template<lang::Case TSensitivity = lang::Case::Sensitive, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
bool | ConsumeString (const TString< TChar > &consumable) |
template<lang::Case TSensitivity = lang::Case::Sensitive, lang::Whitespaces TTrimBeforeConsume = lang::Whitespaces::Keep> | |
bool | ConsumeStringFromEnd (const TString< TChar > &consumable) |
TString< TChar > | ConsumeToken (TChar separator=',') |
template<bool TCheck = true> | |
TSubstring & | Split (integer position, TSubstring &target, integer separatorWidth=0, bool trim=false) |
TSubstring & | Trim (const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces()) |
TSubstring & | TrimEnd (const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces()) |
TSubstring & | TrimStart (const TCString< TChar > &whiteSpaces=TT_StringConstants< TChar >::DefaultWhitespaces()) |
Public Method Index: inherited from TString< TChar > | |
constexpr | TString () noexcept=default |
constexpr | TString (const TString &) noexcept=default |
constexpr | TString (TString &&) noexcept=default |
TString & | operator= (const TString &) noexcept=default |
TString & | operator= (TString &&) noexcept=default |
constexpr | TString (const TChar *pBuffer, integer pLength) noexcept |
template<typename TCharArray > | |
constexpr | TString (const TCharArray &src) |
template<typename TCharArray > | |
operator TCharArray () const | |
template<typename TCharArray > | |
operator TCharArray () const | |
template<bool TCheck = true> | |
TString< TChar > | Substring (integer regionStart, integer regionLength=MAX_LEN) const |
constexpr const TChar * | Buffer () const |
constexpr integer | Length () const |
integer | WStringLength () const |
constexpr bool | IsNull () const |
constexpr bool | IsNotNull () const |
constexpr bool | IsEmpty () const |
constexpr bool | IsNotEmpty () const |
template<bool TCheck = true> | |
TChar | CharAt (integer idx) const |
template<bool TCheck = true> | |
TChar | CharAtStart () const |
template<bool TCheck = true> | |
TChar | CharAtEnd () const |
TChar | operator[] (integer idx) const |
std::size_t | Hashcode () const |
std::size_t | HashcodeIgnoreCase () const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
bool | Equals (const TString< TChar > &rhs) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
int | CompareTo (const TString< TChar > &rhs) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
int | CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength=MAX_LEN) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
int | CompareTo (const TString &rhs, integer rhsRegionStart, integer rhsRegionLength, integer regionStart, integer regionLength=MAX_LEN) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
bool | ContainsAt (const TString &needle, integer pos) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
bool | StartsWith (const TString &needle) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
bool | EndsWith (const TString &needle) const |
template<bool TCheck = true> | |
integer | IndexOf (TChar needle, integer startIdx=0) const |
template<bool TCheck = true> | |
integer | IndexOf (TChar needle, integer regionStart, integer regionLength) const |
integer | IndexOfOrLength (TChar needle) const |
template<bool TCheck = true> | |
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE integer | IndexOfOrLength (TChar needle, integer startIdx) const |
template<bool TCheck = true> | |
ALIB_WARNINGS_RESTORE integer | LastIndexOf (TChar needle, integer startIndex=MAX_LEN) const |
template<lang::Inclusion TInclusion, bool TCheck = true> | |
integer | IndexOfAny (const TString &needles, integer startIdx=0) const |
template<lang::Inclusion TInclusion, bool TCheck = true> | |
integer | LastIndexOfAny (const TString &needles, integer startIdx=MAX_LEN) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
integer | IndexOf (const TString &needle, integer startIdx=0) const |
template<bool TCheck = true> | |
integer | IndexOfFirstDifference (const TString &needle, lang::Case sensitivity=lang::Case::Sensitive, integer idx=0) const |
integer | IndexOfSegmentEnd (TChar opener, TChar closer, integer idx) const |
template<bool TCheck = true> | |
integer | CountChar (TChar needle, integer startPos=0) const |
template<bool TCheck = true> | |
integer | CountChar (TChar needle, TChar omit, integer startPos) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
integer | Count (const TString &needle, integer startPos=0) const |
template<bool TCheck = true, lang::Case TSensitivity = lang::Case::Sensitive> | |
integer | Count (const TString &needle, const TString &omit, integer startPos=0) const |
ALIB_API uint64_t | ParseDecDigits (integer startIdx=0, integer *newIdx=nullptr) const |
ALIB_API int64_t | ParseInt (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
int64_t | ParseInt (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
int64_t | ParseInt (integer *newIdx) const |
int64_t | ParseInt (integer startIdx, integer *newIdx) const |
ALIB_API uint64_t | ParseDec (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
uint64_t | ParseDec (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
uint64_t | ParseDec (integer *newIdx) const |
uint64_t | ParseDec (integer startIdx, integer *newIdx) const |
ALIB_API uint64_t | ParseBin (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
uint64_t | ParseBin (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
uint64_t | ParseBin (integer *newIdx) const |
uint64_t | ParseBin (integer startIdx, integer *newIdx) const |
ALIB_API uint64_t | ParseHex (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
uint64_t | ParseHex (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
uint64_t | ParseHex (integer *newIdx) const |
uint64_t | ParseHex (integer startIdx, integer *newIdx) const |
ALIB_API uint64_t | ParseOct (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
uint64_t | ParseOct (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
uint64_t | ParseOct (integer *newIdx) const |
uint64_t | ParseOct (integer startIdx, integer *newIdx) const |
ALIB_API double | ParseFloat (integer startIdx=0, TNumberFormat< TChar > *numberFormat=nullptr, integer *newIdx=nullptr) const |
double | ParseFloat (TNumberFormat< TChar > *numberFormat, integer *newIdx=nullptr) const |
double | ParseFloat (integer *newIdx) const |
double | ParseFloat (integer startIdx, integer *newIdx) const |
integer | CopyTo (TChar *dest) const |
bool | AdjustRegion (integer ®ionStart, integer ®ionLength) const |
ConstIterator | begin () const |
ConstIterator | cbegin () const |
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE ConstIterator | end () const |
ConstIterator | cend () const |
ALIB_WARNINGS_RESTORE ConstReverseIterator | rbegin () const |
ConstReverseIterator | rend () const |
ConstReverseIterator | crbegin () const |
ConstReverseIterator | crend () const |
TString (ConstIterator &start, ConstIterator &end) | |
Additional Inherited Members | |
Public Type Index: inherited from TString< TChar > | |
using | CharType = TChar |
using | ConstIterator = TRandomAccessIterator<const TChar> |
using | ConstReverseIterator = std::reverse_iterator<ConstIterator> |
|
inline |
Default constructor creating a 6.1 Nulled Strings "nulled" sub-string.
Definition at line 60 of file substring.hpp.
|
inline |
Constructor using a string reference.
src | The source string. |
Definition at line 68 of file substring.hpp.
|
inline |
Sets this object to zero length.
*this
to allow concatenated calls. Definition at line 76 of file substring.hpp.
|
inline |
Consumes an unsigned integer in binary format from the start of this string.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to not using (not allowing) grouping characters.
For more information on number conversion, see class NumberFormat .
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
TIntegral | The output type. Must be statically castable from uint64_t. |
true
if a number was found and consumed, false
otherwise.
|
protected |
Implementation of ConsumeBin (the non-inline part).
[out] | result | A reference to the result value. |
numberFormat | The number format to use. |
true
if a number was found and consumed, false
otherwise. Definition at line 73 of file substring.cpp.
|
inline |
Retrieve and remove the first character from the sub-string.
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
Definition at line 154 of file substring.hpp.
|
inline |
Checks if this object starts with the given character consumable . If it does, this character is cut from this object.
TSensitivity | The sensitivity of the comparison. Defaults to Case::Sensitive. |
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
consumable | The consumable character. |
true
, if this object was starting with consumable and consequently the string was cut by one. Definition at line 191 of file substring.hpp.
|
inline |
Retrieve and remove the last character in the sub-string.
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no check whether this string is empty is performed. |
TTrimBeforeConsume | Determines if the string should be (right-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
Definition at line 250 of file substring.hpp.
|
inline |
Checks if this object ends with the given character consumable . If it does, this character is cut from the end of object.
TSensitivity | The sensitivity of the comparison. Defaults to Case::Sensitive. |
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
consumable | The consumable character. |
true
, if this object was starting with consumable and consequently the string was cut by one. Definition at line 223 of file substring.hpp.
|
inline |
Cuts the given number of characters from the beginning of the Substring and optionally places the portion that was cut in parameter target .
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty, respectively left untouched depending on TTargetData .
If regionLength is greater than this object's length, all contents is 'moved' to target .
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
TTargetData | If CurrentData::Keep , AString target is not cleared before the result is written. Defaults to CurrentData::Clear . |
regionLength | The length of the region at the start to delete. |
target | A target AString that receives the portion that is cut from this object. |
separatorWidth | This width is added to what is cut from this string, while target still receives the portion defined by regionLength . Defaults to 0. |
Definition at line 389 of file substring.hpp.
|
inline |
Cuts the given number of characters from the beginning of the Substring and optionally places the portion that was cut in parameter target .
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty, respectively left untouched depending on TTargetData .
If regionLength is greater than this object's length, all contents is 'moved' to target .
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
regionLength | The length of the region at the start to delete. |
target | A target String that receives the portion that is cut from this object. |
separatorWidth | This width is added to what is cut from this string, while target still receives the portion defined by regionLength . Defaults to 0. |
Definition at line 455 of file substring.hpp.
|
inline |
Cuts the given number of characters from the beginning of the Substring and optionally places the portion that was cut in parameter target (if provided).
If parameter regionLength is negative, nothing is cut and optional argument target is set empty. If regionLength is equal or greater than this object's length, all contents is 'moved' to target .
TCheck | Defaults to true which is the normal invocation mode. If <false> , parameter regionLength has to be in the range of this object's size. |
regionLength | The length of the region at the start to delete. |
target | An optional target Substring that receives the portion that is cut from this object. Defaults to nullptr. |
Definition at line 289 of file substring.hpp.
|
inline |
Cuts the given number of characters from the end of the sub-string and places the portion that was cut in parameter target .
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty, respectively left untouched depending on If
regionLength is greater than this object's length, all contents is 'moved' to target .
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
TTargetData | If CurrentData::Keep , the parameter target is not cleared before the result is written. Defaults to CurrentData::Clear . |
regionLength | The length of the region at the start to delete. |
target | A target AString that receives the portion that is cut from this object. |
separatorWidth | This width is added to what is cut from this string, while target still receives the portion defined by regionLength . Defaults to 0. |
Definition at line 518 of file substring.hpp.
|
inline |
Cuts the given number of characters from the end of the Substring and optionally places the portion that was cut in parameter target (if provided).
Parameter regionLength is checked to be between 0 and length. If negative, nothing is cut and target is set empty. If regionLength is greater than this object's length, all contents is 'moved' to target .
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
regionLength | The length of the region at the start to delete. |
target | An optional target Substring that receives the portion that is cut from this object. Defaults to nullptr. |
Definition at line 336 of file substring.hpp.
|
inline |
Consumes an unsigned integer in standard decimal format from the start of this AString.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to not using (not allowing) grouping characters.
Sign literals '-'
or '+'
are not accepted and parsing will fail. For reading signed integral values, see methods ConsumeInt, for floating point numbers ConsumeFloat.
For more information on number conversion, see class NumberFormat .
TIntegral | The output type. Must be statically castable from uint64_t. |
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
true
if a number was found and consumed, false
otherwise.
|
inline |
Consumes all characters '0'
to '9'
at the start of this object and stores the value they represent in result .
Unlike methods ConsumeInt or ConsumeDec, this method does not consume (accept) sign-, whitespace- or group-characters.
TIntegral | The output type. Must be statically castable from uint64_t. |
[out] | result | A reference to the result value. |
true
if a number was found and consumed, false
otherwise.
|
protected |
Implementation of ConsumeDecDigits (the non-inline part).
[out] | result | A reference to the result value. |
true
if a number was found and consumed, false
otherwise. Definition at line 28 of file substring.cpp.
|
protected |
Implementation of ConsumeDec (the non-inline part).
[out] | result | A reference to the result value. |
numberFormat | The number format to use. |
true
if a number was found and consumed, false
otherwise. Definition at line 57 of file substring.cpp.
|
inline |
Consumes a field from the beginning of this sub-string, which is surrounded by given start end end character identifiers. If both are the same, e.g. '"'
, then the first occurrence of the end character is used. If they are not the same, e.g. '<'
and '>'
, then repeated start characters are counted and consumption only ends when a corresponding amount of end characters has been found.
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
startChar | The start character of the field to consume. |
endChar | The end character of the field to consume. |
Definition at line 684 of file substring.hpp.
template ALIB_API bool ConsumeFloat | ( | double & | result, |
TNumberFormat< TChar > * | numberFormat = nullptr ) |
Consumes a floating point number from the start of this string.
on the given numberFormat instance.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to 'international' settings (not using the locale) and therefore also not parsing grouping characters.
For more information on parsing options for floating point numbers and number conversion in general, see class NumberFormat .
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
true
if a number was found and consumed, false
otherwise. Definition at line 121 of file substring.cpp.
|
inline |
Consumes an unsigned integer in hexadecimal format from the start of this string.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to not using (not allowing) grouping characters.
For more information on number conversion, see class NumberFormat .
TIntegral | The output type. Must be statically castable from uint64_t. |
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
true
if a number was found and consumed, false
otherwise.
|
protected |
Implementation of ConsumeHex (the non-inline part).
[out] | result | A reference to the result value. |
numberFormat | The number format to use. |
true
if a number was found and consumed, false
otherwise. Definition at line 89 of file substring.cpp.
|
inline |
Consumes an integral value in decimal, binary, hexadecimal or octal format from the string.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to not using (not allowing) grouping characters.
For more information on number conversion, see class NumberFormat .
TIntegral | The output type. Must be statically castable from uint64_t. |
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
true
if a number was found and consumed, false
otherwise.
|
protected |
Implementation of ConsumeInt (the non-inline part).
[out] | result | A reference to the result value. |
numberFormat | The number format to use. |
true
if a number was found and consumed, false
otherwise. Definition at line 41 of file substring.cpp.
|
inline |
Consumes an unsigned integer in octal format from the start of this string.
Parameter numberFormat defaults to nullptr
. This denotes static singleton NumberFormat::Computational which is configured to not using (not allowing) grouping characters.
For more information on number conversion, see class NumberFormat .
TIntegral | The output type. Must be statically castable from uint64_t. |
[out] | result | A reference to the result value. |
numberFormat | The number format to use. Defaults to nullptr . |
true
if a number was found and consumed, false
otherwise.
|
protected |
Implementation of ConsumeOct (the non-inline part).
[out] | result | A reference to the result value. |
numberFormat | The number format to use. |
true
if a number was found and consumed, false
otherwise. Definition at line 105 of file substring.cpp.
|
inline |
Consumes a minimum of minChars of string consumable from the start of this sub-string. If the minimum characters could not be found, nothing is consumed, otherwise, the method consumes as much as possible.
This method is useful read "tokens" from a string that may be abbreviated. Within ALib this method is for example used with deserialization of enumeration elements.
TSensitivity | The sensitivity of the comparison. Defaults to Case::Ignore. |
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the first character consume operation. Defaults to Whitespaces::Keep. |
consumable | The consumable string. |
minChars | The minimum amount of characters to consume. If 0 or negative, the length of consumable is chosen. Optional and defaults to 1 . |
Definition at line 652 of file substring.hpp.
|
inline |
Checks if this object starts with the given string consumable . If it does, this string is cut from this object.
TSensitivity | The sensitivity of the comparison. Defaults to Case::Sensitive. |
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
consumable | The consumable string. |
true
, if this object was starting with consumable and consequently the string was cut. Definition at line 590 of file substring.hpp.
|
inline |
Checks if this object ends with the given string consumable . If it does, this string is cut from the end of object.
TSensitivity | The sensitivity of the comparison. Defaults to Case::Sensitive. |
TTrimBeforeConsume | Determines if the string should be (left-) trimmed before the consume operation. Defaults to Whitespaces::Keep. |
consumable | The consumable string |
true
, if this object was starting with consumable and consequently the string was cut. Definition at line 619 of file substring.hpp.
|
inline |
Searches separator and cuts the beginning of this string, including the separator. What was consumed is returned, excluding the separator.
If the separator is not found, all of this string is consumed and returned.
separator | The separator to search. Defaults to ',' . |
Definition at line 557 of file substring.hpp.
|
inline |
Splits this sub-string into two parts. What remains in this object is the region from 0 to position . target receives the rest. If separatorWidth is given, this is subtracted from the front of target .
TCheck | Defaults to true which is the normal invocation mode. If <false> is added to the method name, no parameter check is performed. |
position | The index where this object is split. |
target | The target sub-string to receive the right part of the string. |
separatorWidth | This does not change what remains in this object, but defines the number of characters that are cut from the front of the target . Defaults to 0. |
trim | If true , both sub-strings will be trimmed. |
*this
to allow concatenated calls. Definition at line 942 of file substring.hpp.
|
inline |
Invokes TrimStart and TrimEnd .
whiteSpaces | The characters used for trimming. Defaults to alib::DefaultWhitespaces |
*this
to allow concatenated calls. Definition at line 133 of file substring.hpp.
|
inline |
Moves the start to the first character not found in given character set whiteSpaces .
whiteSpaces | The characters used for trimming. Defaults to alib::DefaultWhitespaces |
*this
to allow concatenated calls. Definition at line 113 of file substring.hpp.
|
inline |
Moves the start to the first character not found in given character set whiteSpaces .
whiteSpaces | The characters used for trimming. Defaults to alib::DefaultWhitespaces |
*this
to allow concatenated calls. Definition at line 89 of file substring.hpp.