MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / SubStringTo

Method SubStringTo

src/Nazara/Core/String.cpp:3985–4002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3983 */
3984
3985 String String::SubStringTo(char character, std::intmax_t startPos, bool toLast, bool include, UInt32 flags) const
3986 {
3987 if (character == '\0')
3988 return *this;
3989
3990 std::size_t pos;
3991 if (toLast)
3992 pos = FindLast(character, startPos);
3993 else
3994 pos = Find(character, startPos, flags);
3995
3996 if (pos == 0)
3997 return (include) ? String(character) : String();
3998 else if (pos == npos)
3999 return *this;
4000
4001 return SubString(0, pos+((include) ? 1 : 0)-1);
4002 }
4003
4004 /*!
4005 * \brief Returns a sub string of the string up to a string

Callers 5

AdvanceMethod · 0.80
AdvanceMethod · 0.80
AdvanceMethod · 0.80
GetDirectoryMethod · 0.80
AbsolutePathMethod · 0.80

Calls 2

GetConstBufferMethod · 0.80
StringClass · 0.50

Tested by

no test coverage detected