engine
 
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | 静态 Public 成员函数 | 友元 | 所有成员列表
FString类 参考

A dynamically sizeable string. 更多...

#include <UnrealString.h>

+ 类 FString 继承关系图:

Public 类型

typedef TArray< TCHAR >::TIterator TIterator
 Iterator typedefs
 

Public 成员函数

template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FORCEINLINE FString & Append (CharRangeType &&Str)
 Append a string and return a reference to this
 
template<class CharType >
FORCEINLINE FString & Append (CharType *Str)
 Append a valid null-terminated string and return a reference to this 更多...
 
template<class CharType >
FORCEINLINE FString & Append (const CharType *Str, int32 Count)
 Append a string and return a reference to this
 
FORCEINLINE FString & AppendChar (TCHAR InChar)
 Append a single character and return a reference to this
 
void AppendChars (const ANSICHAR *Str, int32 Count)
 Appends a character range without null-terminators in it 更多...
 
template<typename FmtType , typename... Types>
TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString & >::Type Appendf (const FmtType &Fmt, Types... Args)
 Just like Printf, but appends the formatted text to the existing FString instead. 更多...
 
void AppendInt (int32 InNum)
 appends the integer InNum to this string
 
FORCEINLINE DataType::RangedForIteratorType begin ()
 DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
 
FORCEINLINE void CheckInvariants () const
 Run slow checks on this string
 
FORCEINLINE int32 Compare (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
 Lexicographically tests how this string compares to the Other given string 更多...
 
FORCEINLINE bool Contains (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Returns whether this string contains the specified substring. 更多...
 
FORCEINLINE bool Contains (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Returns whether this string contains the specified substring. 更多...
 
FString ConvertTabsToSpaces (const int32 InSpacesPerTab) &&
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
FString ConvertTabsToSpaces (const int32 InSpacesPerTab) const &
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
void ConvertTabsToSpacesInline (const int32 InSpacesPerTab)
 Replaces all instances of '\t' with TabWidth number of spaces 更多...
 
FORCEINLINE TConstIterator CreateConstIterator () const
 Creates a const iterator for the characters in this string
 
FORCEINLINE TIterator CreateIterator ()
 Creates an iterator for the characters in this string
 
FORCEINLINE void Empty (int32 Slack=0)
 Create empty string of given size with zero terminating character 更多...
 
bool EndsWith (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string ends with given string. 更多...
 
bool EndsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string ends with given string. 更多...
 
FORCEINLINE bool Equals (const FString &Other, ESearchCase::Type SearchCase=ESearchCase::CaseSensitive) const
 Lexicographically tests whether this string is equivalent to the Other given string 更多...
 
FORCEINLINE int32 Find (const FString &SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
 Searches the string for a substring, and returns index into this string of the first found instance. 更多...
 
int32 Find (const TCHAR *SubStr, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart, int32 StartPosition=INDEX_NONE) const
 Searches the string for a substring, and returns index into this string of the first found instance. 更多...
 
FORCEINLINE bool FindChar (TCHAR InChar, int32 &Index) const
 Searches the string for a character 更多...
 
FORCEINLINE bool FindLastChar (TCHAR InChar, int32 &Index) const
 Searches the string for the last occurrence of a character 更多...
 
template<typename Predicate >
FORCEINLINE int32 FindLastCharByPredicate (Predicate Pred) const
 Searches the string for the last occurrence of a character which matches the specified predicate. 更多...
 
template<typename Predicate >
FORCEINLINE int32 FindLastCharByPredicate (Predicate Pred, int32 Count) const
 Searches an initial substring for the last occurrence of a character which matches the specified predicate. 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
 FString (CharRangeType &&Other)
 Create an FString from a contiguous range of characters 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
 FString (CharRangeType &&Other, int32 ExtraSlack)
 Create an FString from a contiguous range of characters, with extra slack at the end of the string 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (const CharType *Src)
 Constructor using an array of TCHAR 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (const CharType *Src, int32 ExtraSlack)
 Constructor to create FString with specified number of characters from another string with additional character zero 更多...
 
FORCEINLINE FString (const FString &Other, int32 ExtraSlack)
 Create a copy of the Other string with extra space for characters at the end of the string 更多...
 
FORCEINLINE FString (FString &&Other, int32 ExtraSlack)
 Create a copy of the Other string with extra space for characters at the end of the string 更多...
 
template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString (int32 InCount, const CharType *InSrc)
 Constructor to create FString with specified number of characters from another string with additional character zero 更多...
 
FORCEINLINE DataType & GetCharArray ()
 Get string as array of TCHARS 更多...
 
FORCEINLINE const DataType & GetCharArray () const
 Get string as const array of TCHARS
 
FORCEINLINE bool IsEmpty () const
 Test whether this string is empty 更多...
 
bool IsNumeric () const
 Returns true if the string only contains numeric characters
 
FORCEINLINE bool IsValidIndex (int32 Index) const
 Tests if index is valid, i.e. 更多...
 
FORCEINLINE FString Left (int32 Count) const &
 Returns the left most given number of characters
 
FORCEINLINE FString LeftChop (int32 Count) const &
 Returns the left most characters from the string chopping the given number of characters from the end
 
FORCEINLINE void LeftChopInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the left most characters chopping the given number of characters from the end
 
FORCEINLINE void LeftInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the left most given number of characters
 
FString LeftPad (int32 ChCount) const
 Pad the left of this string for ChCount characters
 
FORCEINLINE int32 Len () const
 Get the length of the string, excluding terminating character
 
FORCEINLINE bool MatchesWildcard (const FString &Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Searches this string for a given wild card 更多...
 
bool MatchesWildcard (const TCHAR *Wildcard, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Searches this string for a given wild card 更多...
 
FORCEINLINE FString Mid (int32 Start, int32 Count=MAX_int32) const &
 Returns the substring from Start position for Count characters.
 
FORCEINLINE void MidInline (int32 Start, int32 Count=MAX_int32, bool bAllowShrinking=true)
 Modifies the string such that it is now the substring from Start position for Count characters.
 
FORCEINLINE const TCHAR * operator* () const
 Get pointer to the string 更多...
 
FORCEINLINE FString & operator+= (ANSICHAR Char)
 Append a single character and return a reference to this
 
template<typename StrType >
FORCEINLINE FString & operator+= (StrType &&Str)
 Append a string and return a reference to this
 
FORCEINLINE FString & operator/= (const FString &Str)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE FString & operator/= (const TCHAR *Str)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
template<typename CharRangeType , typename TEnableIf< TIsTCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FString & operator= (CharRangeType &&Other)
 Copy assignment from a contiguous range of characters
 
FORCEINLINE FString & operator= (const TCHAR *Other)
 Copy Assignment from array of TCHAR 更多...
 
FORCEINLINE TCHAR & operator[] (int32 Index)
 Return specific character from this string 更多...
 
FORCEINLINE const TCHAR & operator[] (int32 Index) const
 Return specific const character from this string 更多...
 
int32 ParseIntoArray (TArray< FString > &OutArray, const TCHAR *const *DelimArray, int32 NumDelims, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using the given delimiters 更多...
 
int32 ParseIntoArray (TArray< FString > &OutArray, const TCHAR *pchDelim, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array. 更多...
 
int32 ParseIntoArrayLines (TArray< FString > &OutArray, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using line ending characters 更多...
 
int32 ParseIntoArrayWS (TArray< FString > &OutArray, const TCHAR *pchExtraDelim=nullptr, bool InCullEmpty=true) const
 Breaks up a delimited string into elements of a string array, using any whitespace and an optional extra delimter, like a "," 更多...
 
void PathAppend (const TCHAR *Str, int32 StrLength)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE void RemoveAt (int32 Index, int32 Count=1, bool bAllowShrinking=true)
 Removes characters within the string. 更多...
 
bool RemoveFromEnd (const FString &InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the end of the string if it exists. 更多...
 
bool RemoveFromEnd (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the end of the string if it exists. 更多...
 
bool RemoveFromStart (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the start of the string if it exists. 更多...
 
bool RemoveFromStart (const TCHAR *InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Removes the text from the start of the string if it exists. 更多...
 
void RemoveSpacesInline ()
 Removes spaces from the string. 更多...
 
FString Replace (const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) &&
 Replace all occurrences of a substring in this string 更多...
 
FString Replace (const TCHAR *From, const TCHAR *To, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const &
 Replace all occurrences of a substring in this string 更多...
 
void ReplaceCharInline (const TCHAR SearchChar, const TCHAR ReplacementChar, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Replace all occurrences of a character with another. 更多...
 
FString ReplaceCharWithEscapedChar (const TArray< TCHAR > *Chars=nullptr) &&
 Replaces certain characters with the "escaped" version of that character (i.e. 更多...
 
FString ReplaceCharWithEscapedChar (const TArray< TCHAR > *Chars=nullptr) const &
 Replaces certain characters with the "escaped" version of that character (i.e. 更多...
 
FString ReplaceEscapedCharWithChar (const TArray< TCHAR > *Chars=nullptr) &&
 Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. 更多...
 
FString ReplaceEscapedCharWithChar (const TArray< TCHAR > *Chars=nullptr) const &
 Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version. 更多...
 
int32 ReplaceInline (const TCHAR *SearchText, const TCHAR *ReplacementText, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase)
 Replace all occurrences of SearchText with ReplacementText in this string. 更多...
 
FString ReplaceQuotesWithEscapedQuotes () &&
 Returns a copy of this string with all quote marks escaped (unless the quote is already escaped)
 
FString ReplaceQuotesWithEscapedQuotes () const &
 Returns a copy of this string with all quote marks escaped (unless the quote is already escaped)
 
FORCEINLINE void Reset (int32 NewReservedSize=0)
 Empties the string, but doesn't change memory allocation, unless the new size is larger than the current string. 更多...
 
FString Reverse () &&
 Returns this string, with the characters in reverse order
 
FString Reverse () const &
 Returns a copy of this string, with the characters in reverse order
 
void ReverseString ()
 Reverses the order of characters in this string
 
FORCEINLINE FString Right (int32 Count) const &
 Returns the string to the right of the specified location, counting back from the right (end of the word).
 
FORCEINLINE FString RightChop (int32 Count) const &
 Returns the string to the right of the specified location, counting forward from the left (from the beginning of the word).
 
FORCEINLINE void RightChopInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the string to the right of the specified location, counting forward from the left (from the beginning of the word).
 
FORCEINLINE void RightInline (int32 Count, bool bAllowShrinking=true)
 Modifies the string such that it is now the right most given number of characters
 
FString RightPad (int32 ChCount) const
 Pad the right of this string for ChCount characters
 
void SerializeAsANSICharArray (FArchive &Ar, int32 MinCharacters=0) const
 Serializes a string as ANSI char array. 更多...
 
FORCEINLINE void Shrink ()
 Remove unallocated empty character space from the end of this string
 
bool Split (const FString &InS, FString *LeftS, FString *RightS, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase, ESearchDir::Type SearchDir=ESearchDir::FromStart) const
 Splits this string at given string position case sensitive. 更多...
 
bool StartsWith (const FString &InPrefix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string starts with given string. 更多...
 
bool StartsWith (const TCHAR *InSuffix, ESearchCase::Type SearchCase=ESearchCase::IgnoreCase) const
 Test whether this string starts with given string. 更多...
 
bool ToBool () const
 Converts a string into a boolean value 1, "True", "Yes", FCoreTexts::True, FCoreTexts::Yes, and non-zero integers become true 0, "False", "No", FCoreTexts::False, FCoreTexts::No, and unparsable values become false 更多...
 
FString ToLower () &&
 Converts all characters in this rvalue string to lowercase and moves it into the returned string. 更多...
 
FString ToLower () const &
 Returns a new string with the characters of this converted to lowercase
 
void ToLowerInline ()
 Converts all characters in this string to lowercase
 
FString ToUpper () &&
 Converts all characters in this rvalue string to uppercase and moves it into the returned string. 更多...
 
FString ToUpper () const &
 Returns a new string with the characters of this converted to uppercase
 
void ToUpperInline ()
 Converts all characters in this string to uppercase
 
FString TrimEnd () &&
 Removes whitespace characters from the end of this string. 更多...
 
FString TrimEnd () const &
 Removes whitespace characters from the end of this string. 更多...
 
void TrimEndInline ()
 Removes whitespace characters from the end of this string. 更多...
 
FString TrimQuotes (bool *bQuotesRemoved=nullptr) &&
 Returns this string with wrapping quotation marks removed.
 
FString TrimQuotes (bool *bQuotesRemoved=nullptr) const &
 Returns a copy of this string with wrapping quotation marks removed.
 
void TrimQuotesInline (bool *bQuotesRemoved=nullptr)
 Trims wrapping quotation marks from this string.
 
FString TrimStart () &&
 Removes whitespace characters from the start of this string. 更多...
 
FString TrimStart () const &
 Removes whitespace characters from the start of this string. 更多...
 
FString TrimStartAndEnd () &&
 Removes whitespace characters from the start and end of this string. 更多...
 
FString TrimStartAndEnd () const &
 Removes whitespace characters from the start and end of this string. 更多...
 
void TrimStartAndEndInline ()
 Removes whitespace characters from the start and end of this string. 更多...
 
void TrimStartInline ()
 Removes whitespace characters from the start of this string. 更多...
 
void TrimToNullTerminator ()
 Trims the inner array after the null terminator.
 

静态 Public 成员函数

static FString Chr (TCHAR Ch)
 Returns a string containing only the Ch character
 
static FString ChrN (int32 NumCharacters, TCHAR Char)
 Returns a string that is full of a variable number of characters 更多...
 
static int32 CullArray (TArray< FString > *InArray)
 Takes an array of strings and removes any zero length entries. 更多...
 
static FString Format (const TCHAR *InFormatString, const FStringFormatNamedArguments &InNamedArguments)
 Format the specified string using the specified arguments. 更多...
 
static FString Format (const TCHAR *InFormatString, const FStringFormatOrderedArguments &InOrderedArguments)
 Format the specified string using the specified arguments. 更多...
 
static FString FromBlob (const uint8 *SrcBuffer, const uint32 SrcSize)
 Converts a buffer to a string 更多...
 
static FString FromHexBlob (const uint8 *SrcBuffer, const uint32 SrcSize)
 Converts a buffer to a string by hex-ifying the elements 更多...
 
static FORCEINLINE FString FromInt (int32 Num)
 Converts an integer to a string.
 
template<typename RangeType >
static FString Join (const RangeType &Range, const TCHAR *Separator)
 Joins a range of 'something that can be concatentated to strings with +=' together into a single string with separators. 更多...
 
template<typename RangeType , typename ProjectionType >
static FString JoinBy (const RangeType &Range, const TCHAR *Separator, ProjectionType Proj)
 Joins a range of elements together into a single string with separators using a projection function. 更多...
 
template<typename FmtType , typename... Types>
static TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString >::Type Printf (const FmtType &Fmt, Types... Args)
 Constructs FString object similarly to how classic sprintf works. 更多...
 
static FString SanitizeFloat (double InFloat, const int32 InMinFractionalDigits=1)
 Converts a float string with the trailing zeros stripped For example - 1.234 will be "1.234" rather than "1.234000" 更多...
 
static bool ToBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
 Converts a string into a buffer 更多...
 
static bool ToHexBlob (const FString &Source, uint8 *DestBuffer, const uint32 DestSize)
 Converts a string into a buffer 更多...
 

友元

template<typename CharType >
FORCEINLINE friend bool operator!= (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is != the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator!= (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is != the right string 更多...
 
FORCEINLINE friend bool operator!= (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is != the right string 更多...
 
template<typename CharType >
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+ (const FString &Lhs, CharType Rhs)
 Concatenates an FString with a TCHAR. 更多...
 
FORCEINLINE friend FString operator+ (const FString &Lhs, const FString &Rhs)
 Concatenate two FStrings. 更多...
 
FORCEINLINE friend FString operator+ (const FString &Lhs, const TCHAR *Rhs)
 Concatenates an FString to a TCHAR array. 更多...
 
FORCEINLINE friend FString operator+ (const FString &Lhs, FString &&Rhs)
 Concatenate two FStrings. 更多...
 
FORCEINLINE friend FString operator+ (const TCHAR *Lhs, const FString &Rhs)
 Concatenates a TCHAR array to an FString. 更多...
 
FORCEINLINE friend FString operator+ (const TCHAR *Lhs, FString &&Rhs)
 Concatenates a TCHAR array to an FString. 更多...
 
template<typename CharType >
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+ (FString &&Lhs, CharType Rhs)
 Concatenates an FString with a TCHAR. 更多...
 
FORCEINLINE friend FString operator+ (FString &&Lhs, const FString &Rhs)
 Concatenate two FStrings. 更多...
 
FORCEINLINE friend FString operator+ (FString &&Lhs, const TCHAR *Rhs)
 Concatenates an FString to a TCHAR array. 更多...
 
FORCEINLINE friend FString operator+ (FString &&Lhs, FString &&Rhs)
 Concatenate two FStrings. 更多...
 
FORCEINLINE friend FString operator/ (const FString &Lhs, const FString &Rhs)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE friend FString operator/ (const FString &Lhs, const TCHAR *Rhs)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE friend FString operator/ (const TCHAR *Lhs, const FString &Rhs)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE friend FString operator/ (FString &&Lhs, const FString &Rhs)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
FORCEINLINE friend FString operator/ (FString &&Lhs, const TCHAR *Rhs)
 Concatenate this path with given path ensuring the / character is used between them 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator< (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is < the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator< (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is < the right string 更多...
 
FORCEINLINE friend bool operator< (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is < the right string 更多...
 
CORE_API FArchive & operator<< (FArchive &Ar, FString &S)
 Serializes the string. 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator<= (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is <= the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator<= (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is <= the right string 更多...
 
FORCEINLINE friend bool operator<= (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is <= the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator== (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is == the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator== (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is == the right string 更多...
 
FORCEINLINE friend bool operator== (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is == the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator> (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is > the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator> (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is > the right string 更多...
 
FORCEINLINE friend bool operator> (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is > the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator>= (const CharType *Lhs, const FString &Rhs)
 Lexicographically test whether the left string is >= the right string 更多...
 
template<typename CharType >
FORCEINLINE friend bool operator>= (const FString &Lhs, const CharType *Rhs)
 Lexicographically test whether the left string is >= the right string 更多...
 
FORCEINLINE friend bool operator>= (const FString &Lhs, const FString &Rhs)
 Lexicographically test whether the left string is >= the right string 更多...
 

详细描述

A dynamically sizeable string.

参见
https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/FString/
示例
/github/workspace/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

构造及析构函数说明

◆ FString() [1/7]

FORCEINLINE FString::FString ( const FString &  Other,
int32  ExtraSlack 
)
inline

Create a copy of the Other string with extra space for characters at the end of the string

参数
Otherthe other string to create a new copy from
ExtraSlacknumber of extra characters to add to the end of the other string in this string

◆ FString() [2/7]

FORCEINLINE FString::FString ( FString &&  Other,
int32  ExtraSlack 
)
inline

Create a copy of the Other string with extra space for characters at the end of the string

参数
Otherthe other string to create a new copy from
ExtraSlacknumber of extra characters to add to the end of the other string in this string

◆ FString() [3/7]

template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString::FString ( const CharType *  Src)
inline

Constructor using an array of TCHAR

参数
Inarray of TCHAR

◆ FString() [4/7]

template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString::FString ( int32  InCount,
const CharType *  InSrc 
)
inlineexplicit

Constructor to create FString with specified number of characters from another string with additional character zero

参数
InCounthow many characters to copy
InSrcString to copy from

◆ FString() [5/7]

template<typename CharType , typename = typename TEnableIf<TIsCharType<CharType>::Value>::Type>
FORCEINLINE FString::FString ( const CharType *  Src,
int32  ExtraSlack 
)
inline

Constructor to create FString with specified number of characters from another string with additional character zero

参数
Otherthe other string to create a new copy from
ExtraSlacknumber of extra characters to add to the end of the other string in this string

◆ FString() [6/7]

template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FString::FString ( CharRangeType &&  Other)
inlineexplicit

Create an FString from a contiguous range of characters

参数
OtherThe contiguous character range to copy from

◆ FString() [7/7]

template<typename CharRangeType , typename TEnableIf< TIsCharRangeNotCArray< CharRangeType >::Value >::Type * = nullptr>
FString::FString ( CharRangeType &&  Other,
int32  ExtraSlack 
)
inlineexplicit

Create an FString from a contiguous range of characters, with extra slack at the end of the string

参数
OtherThe contiguous character range to copy from
ExtraSlackThe number of extra characters to reserve space for in the new string

成员函数说明

◆ Append()

template<class CharType >
FORCEINLINE FString & FString::Append ( CharType *  Str)
inline

Append a valid null-terminated string and return a reference to this

CharType is not const to use this overload for mutable char arrays and call Strlen() instead of getting the static length N from GetNum((&T)[N]). Oddly MSVC ranks a const T* overload over T&& for T[N] while clang picks T&&.

◆ AppendChars()

void FString::AppendChars ( const ANSICHAR *  Str,
int32  Count 
)

Appends a character range without null-terminators in it

参数
Strcan be null if Count is 0. Can be unterminated, Str[Count] isn't read.

◆ Appendf()

template<typename FmtType , typename... Types>
TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString & >::Type FString::Appendf ( const FmtType &  Fmt,
Types...  Args 
)
inline

Just like Printf, but appends the formatted text to the existing FString instead.

返回
a reference to the modified string, so that it can be chained

◆ ChrN()

static FString FString::ChrN ( int32  NumCharacters,
TCHAR  Char 
)
static

Returns a string that is full of a variable number of characters

参数
NumCharactersNumber of characters to put into the string
CharCharacter to put into the string
返回
The string of NumCharacters characters.

◆ Compare()

FORCEINLINE int32 FString::Compare ( const FString &  Other,
ESearchCase::Type  SearchCase = ESearchCase::CaseSensitive 
) const
inline

Lexicographically tests how this string compares to the Other given string

参数
OtherThe string test against
SearchCaseWhether or not the comparison should ignore case
返回
0 if equal, negative if less than, positive if greater than

◆ Contains() [1/2]

FORCEINLINE bool FString::Contains ( const FString &  SubStr,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase,
ESearchDir::Type  SearchDir = ESearchDir::FromStart 
) const
inline

Returns whether this string contains the specified substring.

参数
SubStrFind to search for
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
SearchDirIndicates whether the search starts at the beginning or at the end ( defaults to ESearchDir::FromStart )
返回
Returns whether the string contains the substring

◆ Contains() [2/2]

FORCEINLINE bool FString::Contains ( const TCHAR *  SubStr,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase,
ESearchDir::Type  SearchDir = ESearchDir::FromStart 
) const
inline

Returns whether this string contains the specified substring.

参数
SubStrFind to search for
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
SearchDirIndicates whether the search starts at the beginning or at the end ( defaults to ESearchDir::FromStart )
返回
Returns whether the string contains the substring

◆ ConvertTabsToSpaces() [1/2]

FString FString::ConvertTabsToSpaces ( const int32  InSpacesPerTab) &&
inline

Replaces all instances of '\t' with TabWidth number of spaces

参数
InSpacesPerTab- Number of spaces that a tab represents
返回
copy of this string with replacement made

◆ ConvertTabsToSpaces() [2/2]

FString FString::ConvertTabsToSpaces ( const int32  InSpacesPerTab) const &
inline

Replaces all instances of '\t' with TabWidth number of spaces

参数
InSpacesPerTab- Number of spaces that a tab represents
返回
copy of this string with replacement made

◆ ConvertTabsToSpacesInline()

void FString::ConvertTabsToSpacesInline ( const int32  InSpacesPerTab)

Replaces all instances of '\t' with TabWidth number of spaces

参数
InSpacesPerTab- Number of spaces that a tab represents

◆ CullArray()

static int32 FString::CullArray ( TArray< FString > *  InArray)
static

Takes an array of strings and removes any zero length entries.

参数
InArrayThe array to cull
返回
The number of elements left in InArray

◆ Empty()

FORCEINLINE void FString::Empty ( int32  Slack = 0)
inline

Create empty string of given size with zero terminating character

参数
Slacklength of empty string to create

◆ EndsWith() [1/2]

bool FString::EndsWith ( const FString &  InSuffix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const

Test whether this string ends with given string.

参数
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string ends with specified text, false otherwise

◆ EndsWith() [2/2]

bool FString::EndsWith ( const TCHAR *  InSuffix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const

Test whether this string ends with given string.

参数
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string ends with specified text, false otherwise

◆ Equals()

FORCEINLINE bool FString::Equals ( const FString &  Other,
ESearchCase::Type  SearchCase = ESearchCase::CaseSensitive 
) const
inline

Lexicographically tests whether this string is equivalent to the Other given string

参数
OtherThe string test against
SearchCaseWhether or not the comparison should ignore case
返回
true if this string is lexicographically equivalent to the other, otherwise false

◆ Find() [1/2]

FORCEINLINE int32 FString::Find ( const FString &  SubStr,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase,
ESearchDir::Type  SearchDir = ESearchDir::FromStart,
int32  StartPosition = INDEX_NONE 
) const
inline

Searches the string for a substring, and returns index into this string of the first found instance.

Can search from beginning or end, and ignore case or not.

参数
SubStrThe string to search for
StartPositionThe start character position to search from
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
SearchDirIndicates whether the search starts at the beginning or at the end ( defaults to ESearchDir::FromStart )

◆ Find() [2/2]

int32 FString::Find ( const TCHAR *  SubStr,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase,
ESearchDir::Type  SearchDir = ESearchDir::FromStart,
int32  StartPosition = INDEX_NONE 
) const

Searches the string for a substring, and returns index into this string of the first found instance.

Can search from beginning or end, and ignore case or not.

参数
SubStrThe string array of TCHAR to search for
StartPositionThe start character position to search from
SearchCaseIndicates whether the search is case sensitive or not
SearchDirIndicates whether the search starts at the beginning or at the end.

◆ FindChar()

FORCEINLINE bool FString::FindChar ( TCHAR  InChar,
int32 &  Index 
) const
inline

Searches the string for a character

参数
InCharthe character to search for
Indexout the position the character was found at, INDEX_NONE if return is false
返回
true if character was found in this string, otherwise false

◆ FindLastChar()

FORCEINLINE bool FString::FindLastChar ( TCHAR  InChar,
int32 &  Index 
) const
inline

Searches the string for the last occurrence of a character

参数
InCharthe character to search for
Indexout the position the character was found at, INDEX_NONE if return is false
返回
true if character was found in this string, otherwise false

◆ FindLastCharByPredicate() [1/2]

template<typename Predicate >
FORCEINLINE int32 FString::FindLastCharByPredicate ( Predicate  Pred) const
inline

Searches the string for the last occurrence of a character which matches the specified predicate.

参数
PredPredicate that takes TCHAR and returns true if TCHAR matches search criteria, false otherwise.
StartIndexIndex of element from which to start searching. Defaults to last TCHAR in string.
返回
Index of found TCHAR, INDEX_NONE otherwise.

◆ FindLastCharByPredicate() [2/2]

template<typename Predicate >
FORCEINLINE int32 FString::FindLastCharByPredicate ( Predicate  Pred,
int32  Count 
) const
inline

Searches an initial substring for the last occurrence of a character which matches the specified predicate.

参数
PredPredicate that takes TCHAR and returns true if TCHAR matches search criteria, false otherwise.
CountThe number of characters from the front of the string through which to search.
返回
Index of found TCHAR, INDEX_NONE otherwise.

◆ Format() [1/2]

static FString FString::Format ( const TCHAR *  InFormatString,
const FStringFormatNamedArguments &  InNamedArguments 
)
static

Format the specified string using the specified arguments.

Replaces instances of { Argument } with keys in the map matching 'Argument'

参数
InFormatStringA string representing the format expression
InNamedArgumentsA map of named arguments that match the tokens specified in InExpression
返回
A string containing the formatted text

◆ Format() [2/2]

static FString FString::Format ( const TCHAR *  InFormatString,
const FStringFormatOrderedArguments &  InOrderedArguments 
)
static

Format the specified string using the specified arguments.

Replaces instances of {0} with indices from the given array matching the index specified in the token

参数
InFormatStringA string representing the format expression
InOrderedArgumentsAn array of ordered arguments that match the tokens specified in InExpression
返回
A string containing the formatted text

◆ FromBlob()

static FString FString::FromBlob ( const uint8 *  SrcBuffer,
const uint32  SrcSize 
)
static

Converts a buffer to a string

参数
SrcBufferthe buffer to stringify
SrcSizethe number of bytes to convert
返回
the blob in string form

◆ FromHexBlob()

static FString FString::FromHexBlob ( const uint8 *  SrcBuffer,
const uint32  SrcSize 
)
static

Converts a buffer to a string by hex-ifying the elements

参数
SrcBufferthe buffer to stringify
SrcSizethe number of bytes to convert
返回
the blob in string form

◆ GetCharArray()

FORCEINLINE DataType & FString::GetCharArray ( )
inline

Get string as array of TCHARS

警告
: Operations on the TArray<*CHAR> can be unsafe, such as adding non-terminating 0's or removing the terminating zero.

◆ IsEmpty()

FORCEINLINE bool FString::IsEmpty ( ) const
inline

Test whether this string is empty

返回
true if this string is empty, otherwise return false.

◆ IsValidIndex()

FORCEINLINE bool FString::IsValidIndex ( int32  Index) const
inline

Tests if index is valid, i.e.

greater than or equal to zero, and less than the number of characters in this string (excluding the null terminator).

参数
IndexIndex to test.
返回
True if index is valid. False otherwise.

◆ Join()

template<typename RangeType >
static FString FString::Join ( const RangeType &  Range,
const TCHAR *  Separator 
)
inlinestatic

Joins a range of 'something that can be concatentated to strings with +=' together into a single string with separators.

参数
RangeThe range of 'things' to concatenate.
SeparatorThe string used to separate each element.
返回
The final, joined, separated string.

◆ JoinBy()

template<typename RangeType , typename ProjectionType >
static FString FString::JoinBy ( const RangeType &  Range,
const TCHAR *  Separator,
ProjectionType  Proj 
)
inlinestatic

Joins a range of elements together into a single string with separators using a projection function.

参数
RangeThe range of 'things' to concatenate.
SeparatorThe string used to separate each element.
ProjThe projection used to get a string for each element.
返回
The final, joined, separated string.

◆ MatchesWildcard() [1/2]

FORCEINLINE bool FString::MatchesWildcard ( const FString &  Wildcard,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const
inline

Searches this string for a given wild card

参数
Wildcard*?-type wildcard
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string matches the *?-type wildcard given.
警告
This is a simple, SLOW routine. Use with caution

◆ MatchesWildcard() [2/2]

bool FString::MatchesWildcard ( const TCHAR *  Wildcard,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const

Searches this string for a given wild card

参数
Wildcard*?-type wildcard
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string matches the *?-type wildcard given.
警告
This is a simple, SLOW routine. Use with caution

◆ operator*()

FORCEINLINE const TCHAR * FString::operator* ( ) const
inline

Get pointer to the string

@Return Pointer to Array of TCHAR if Num, otherwise the empty string

◆ operator/=() [1/2]

FORCEINLINE FString & FString::operator/= ( const FString &  Str)
inline

Concatenate this path with given path ensuring the / character is used between them

参数
Strpath FString to be concatenated onto the end of this
返回
reference to path

◆ operator/=() [2/2]

FORCEINLINE FString & FString::operator/= ( const TCHAR *  Str)
inline

Concatenate this path with given path ensuring the / character is used between them

参数
Strpath array of TCHAR to be concatenated onto the end of this
返回
reference to path

◆ operator=()

FORCEINLINE FString & FString::operator= ( const TCHAR *  Other)
inline

Copy Assignment from array of TCHAR

参数
Otherarray of TCHAR

◆ operator[]() [1/2]

FORCEINLINE TCHAR & FString::operator[] ( int32  Index)
inline

Return specific character from this string

参数
Indexinto string
返回
Character at Index

◆ operator[]() [2/2]

FORCEINLINE const TCHAR & FString::operator[] ( int32  Index) const
inline

Return specific const character from this string

参数
Indexinto string
返回
const Character at Index

◆ ParseIntoArray() [1/2]

int32 FString::ParseIntoArray ( TArray< FString > &  OutArray,
const TCHAR *const *  DelimArray,
int32  NumDelims,
bool  InCullEmpty = true 
) const

Breaks up a delimited string into elements of a string array, using the given delimiters

警告
Caution!! this routine is O(N^2) allocations...use it for parsing very short text or not at all!
参数
InArrayThe array to fill with the string pieces
DelimArrayThe strings to delimit on
NumDelimsThe number of delimiters.
返回
The number of elements in InArray

◆ ParseIntoArray() [2/2]

int32 FString::ParseIntoArray ( TArray< FString > &  OutArray,
const TCHAR *  pchDelim,
bool  InCullEmpty = true 
) const

Breaks up a delimited string into elements of a string array.

参数
InArrayThe array to fill with the string pieces
pchDelimThe string to delimit on
InCullEmptyIf 1, empty strings are not added to the array
返回
The number of elements in InArray

◆ ParseIntoArrayLines()

int32 FString::ParseIntoArrayLines ( TArray< FString > &  OutArray,
bool  InCullEmpty = true 
) const

Breaks up a delimited string into elements of a string array, using line ending characters

警告
Caution!! this routine is O(N^2) allocations...use it for parsing very short text or not at all!
参数
InArrayThe array to fill with the string pieces
返回
The number of elements in InArray

◆ ParseIntoArrayWS()

int32 FString::ParseIntoArrayWS ( TArray< FString > &  OutArray,
const TCHAR *  pchExtraDelim = nullptr,
bool  InCullEmpty = true 
) const

Breaks up a delimited string into elements of a string array, using any whitespace and an optional extra delimter, like a ","

警告
Caution!! this routine is O(N^2) allocations...use it for parsing very short text or not at all!
参数
InArrayThe array to fill with the string pieces
pchExtraDelimThe string to delimit on
返回
The number of elements in InArray

◆ PathAppend()

void FString::PathAppend ( const TCHAR *  Str,
int32  StrLength 
)

Concatenate this path with given path ensuring the / character is used between them

参数
StrPointer to an array of TCHARs (not necessarily null-terminated) to be concatenated onto the end of this.
StrLengthExact number of characters from Str to append.

◆ Printf()

template<typename FmtType , typename... Types>
static TEnableIf< TIsArrayOrRefOfType< FmtType, TCHAR >::Value, FString >::Type FString::Printf ( const FmtType &  Fmt,
Types...  Args 
)
inlinestatic

Constructs FString object similarly to how classic sprintf works.

参数
FormatFormat string that specifies how FString should be built optionally using additional args. Refer to standard printf format.
...Depending on format function may require additional arguments to build output object.
返回
FString object that was constructed using format and additional parameters.

◆ RemoveAt()

FORCEINLINE void FString::RemoveAt ( int32  Index,
int32  Count = 1,
bool  bAllowShrinking = true 
)
inline

Removes characters within the string.

参数
IndexThe index of the first character to remove.
CountThe number of characters to remove.
bAllowShrinkingWhether or not to reallocate to shrink the storage after removal.

◆ RemoveFromEnd() [1/2]

bool FString::RemoveFromEnd ( const FString &  InSuffix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)

Removes the text from the end of the string if it exists.

参数
InSuffixthe suffix to search for at the end of the string to remove.
返回
true if the suffix was removed, otherwise false.

◆ RemoveFromEnd() [2/2]

bool FString::RemoveFromEnd ( const TCHAR *  InSuffix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)

Removes the text from the end of the string if it exists.

参数
InSuffixthe suffix to search for at the end of the string to remove.
返回
true if the suffix was removed, otherwise false.

◆ RemoveFromStart() [1/2]

bool FString::RemoveFromStart ( const FString &  InPrefix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)

Removes the text from the start of the string if it exists.

参数
InPrefixthe prefix to search for at the start of the string to remove.
返回
true if the prefix was removed, otherwise false.

◆ RemoveFromStart() [2/2]

bool FString::RemoveFromStart ( const TCHAR *  InPrefix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)

Removes the text from the start of the string if it exists.

参数
InPrefixthe prefix to search for at the start of the string to remove.
返回
true if the prefix was removed, otherwise false.

◆ RemoveSpacesInline()

void FString::RemoveSpacesInline ( )

Removes spaces from the string.

I.E. "Spaces Are Cool" --> "SpacesAreCool".

◆ Replace() [1/2]

FString FString::Replace ( const TCHAR *  From,
const TCHAR *  To,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) &&

Replace all occurrences of a substring in this string

参数
Fromsubstring to replace
Tosubstring to replace From with
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
a copy of this string with the replacement made

◆ Replace() [2/2]

FString FString::Replace ( const TCHAR *  From,
const TCHAR *  To,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const &

Replace all occurrences of a substring in this string

参数
Fromsubstring to replace
Tosubstring to replace From with
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
a copy of this string with the replacement made

◆ ReplaceCharInline()

void FString::ReplaceCharInline ( const TCHAR  SearchChar,
const TCHAR  ReplacementChar,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)
inline

Replace all occurrences of a character with another.

参数
SearchCharCharacter to remove from this FString
ReplacementCharReplacement character
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
注解
no dynamic allocation

◆ ReplaceCharWithEscapedChar() [1/2]

FString FString::ReplaceCharWithEscapedChar ( const TArray< TCHAR > *  Chars = nullptr) &&

Replaces certain characters with the "escaped" version of that character (i.e.

replaces "\n" with "\\n"). The characters supported are: {
, \r, \t, \', ", \ }.

参数
Charsby default, replaces all supported characters; this parameter allows you to limit the replacement to a subset.
返回
a string with all control characters replaced by the escaped version.

◆ ReplaceCharWithEscapedChar() [2/2]

FString FString::ReplaceCharWithEscapedChar ( const TArray< TCHAR > *  Chars = nullptr) const &
inline

Replaces certain characters with the "escaped" version of that character (i.e.

replaces "\n" with "\\n"). The characters supported are: {
, \r, \t, \', ", \ }.

参数
Charsby default, replaces all supported characters; this parameter allows you to limit the replacement to a subset.
返回
a string with all control characters replaced by the escaped version.

◆ ReplaceEscapedCharWithChar() [1/2]

FString FString::ReplaceEscapedCharWithChar ( const TArray< TCHAR > *  Chars = nullptr) &&

Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version.

(i.e. replaces "\\n" with "\n". Counterpart to ReplaceCharWithEscapedChar().

返回
copy of this string with replacement made

◆ ReplaceEscapedCharWithChar() [2/2]

FString FString::ReplaceEscapedCharWithChar ( const TArray< TCHAR > *  Chars = nullptr) const &
inline

Removes the escape backslash for all supported characters, replacing the escape and character with the non-escaped version.

(i.e. replaces "\\n" with "\n". Counterpart to ReplaceCharWithEscapedChar().

返回
copy of this string with replacement made

◆ ReplaceInline()

int32 FString::ReplaceInline ( const TCHAR *  SearchText,
const TCHAR *  ReplacementText,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
)

Replace all occurrences of SearchText with ReplacementText in this string.

参数
SearchTextthe text that should be removed from this string
ReplacementTextthe text to insert in its place
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
the number of occurrences of SearchText that were replaced.

◆ Reset()

FORCEINLINE void FString::Reset ( int32  NewReservedSize = 0)
inline

Empties the string, but doesn't change memory allocation, unless the new size is larger than the current string.

参数
NewReservedSizeThe expected usage size (in characters, not including the terminator) after calling this function.

◆ SanitizeFloat()

static FString FString::SanitizeFloat ( double  InFloat,
const int32  InMinFractionalDigits = 1 
)
static

Converts a float string with the trailing zeros stripped For example - 1.234 will be "1.234" rather than "1.234000"

参数
InFloatThe float to sanitize
InMinFractionalDigitsThe minimum number of fractional digits the number should have (will be padded with zero)
返回
sanitized string version of float

◆ SerializeAsANSICharArray()

void FString::SerializeAsANSICharArray ( FArchive &  Ar,
int32  MinCharacters = 0 
) const

Serializes a string as ANSI char array.

参数
StringString to serialize
ArArchive to serialize with
MinCharactersMinimum number of characters to serialize.

◆ Split()

bool FString::Split ( const FString &  InS,
FString *  LeftS,
FString *  RightS,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase,
ESearchDir::Type  SearchDir = ESearchDir::FromStart 
) const
inline

Splits this string at given string position case sensitive.

参数
InStrThe string to search and split at
LeftSout the string to the left of InStr, not updated if return is false. LeftS must not point to the same location as RightS, but can point to this.
RightSout the string to the right of InStr, not updated if return is false. RightS must not point to the same location as LeftS, but can point to this.
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
SearchDirIndicates whether the search starts at the beginning or at the end ( defaults to ESearchDir::FromStart )
返回
true if string is split, otherwise false

◆ StartsWith() [1/2]

bool FString::StartsWith ( const FString &  InPrefix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const

Test whether this string starts with given string.

参数
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string begins with specified text, false otherwise

◆ StartsWith() [2/2]

bool FString::StartsWith ( const TCHAR *  InSuffix,
ESearchCase::Type  SearchCase = ESearchCase::IgnoreCase 
) const

Test whether this string starts with given string.

参数
SearchCaseIndicates whether the search is case sensitive or not ( defaults to ESearchCase::IgnoreCase )
返回
true if this string begins with specified text, false otherwise

◆ ToBlob()

static bool FString::ToBlob ( const FString &  Source,
uint8 *  DestBuffer,
const uint32  DestSize 
)
static

Converts a string into a buffer

参数
DestBufferthe buffer to fill with the string data
DestSizethe size of the buffer in bytes (must be at least string len / 3)
返回
true if the conversion happened, false otherwise

◆ ToBool()

bool FString::ToBool ( ) const

Converts a string into a boolean value 1, "True", "Yes", FCoreTexts::True, FCoreTexts::Yes, and non-zero integers become true 0, "False", "No", FCoreTexts::False, FCoreTexts::No, and unparsable values become false

返回
The boolean value

◆ ToHexBlob()

static bool FString::ToHexBlob ( const FString &  Source,
uint8 *  DestBuffer,
const uint32  DestSize 
)
static

Converts a string into a buffer

参数
DestBufferthe buffer to fill with the string data
DestSizethe size of the buffer in bytes (must be at least string len / 2)
返回
true if the conversion happened, false otherwise

◆ ToLower()

FString FString::ToLower ( ) &&

Converts all characters in this rvalue string to lowercase and moves it into the returned string.

返回
a new string with the characters of this converted to lowercase

◆ ToUpper()

FString FString::ToUpper ( ) &&

Converts all characters in this rvalue string to uppercase and moves it into the returned string.

返回
a new string with the characters of this converted to uppercase

◆ TrimEnd() [1/2]

FString FString::TrimEnd ( ) &&

Removes whitespace characters from the end of this string.

注解
Unlike TrimTrailing() this function returns a copy, and does not mutate the string.

◆ TrimEnd() [2/2]

FString FString::TrimEnd ( ) const &

Removes whitespace characters from the end of this string.

注解
Unlike TrimTrailing() this function returns a copy, and does not mutate the string.

◆ TrimEndInline()

void FString::TrimEndInline ( )

Removes whitespace characters from the end of this string.

Modifies the string in-place.

◆ TrimStart() [1/2]

FString FString::TrimStart ( ) &&

Removes whitespace characters from the start of this string.

注解
Unlike Trim() this function returns a copy, and does not mutate the string.

◆ TrimStart() [2/2]

FString FString::TrimStart ( ) const &

Removes whitespace characters from the start of this string.

注解
Unlike Trim() this function returns a copy, and does not mutate the string.

◆ TrimStartAndEnd() [1/2]

FString FString::TrimStartAndEnd ( ) &&

Removes whitespace characters from the start and end of this string.

注解
Unlike Trim() this function returns a copy, and does not mutate the string.

◆ TrimStartAndEnd() [2/2]

FString FString::TrimStartAndEnd ( ) const &

Removes whitespace characters from the start and end of this string.

注解
Unlike Trim() this function returns a copy, and does not mutate the string.

◆ TrimStartAndEndInline()

void FString::TrimStartAndEndInline ( )

Removes whitespace characters from the start and end of this string.

Modifies the string in-place.

◆ TrimStartInline()

void FString::TrimStartInline ( )

Removes whitespace characters from the start of this string.

Modifies the string in-place.

友元及相关函数文档

◆ operator!= [1/3]

template<typename CharType >
FORCEINLINE friend bool operator!= ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is != the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically != the right string, otherwise false
注解
case insensitive

◆ operator!= [2/3]

template<typename CharType >
FORCEINLINE friend bool operator!= ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is != the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically != the right string, otherwise false
注解
case insensitive

◆ operator!= [3/3]

FORCEINLINE friend bool operator!= ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is != the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically != the right string, otherwise false
注解
case insensitive

◆ operator+ [1/10]

template<typename CharType >
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+ ( const FString &  Lhs,
CharType  Rhs 
)
friend

Concatenates an FString with a TCHAR.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe char on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [2/10]

FORCEINLINE friend FString operator+ ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Concatenate two FStrings.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [3/10]

FORCEINLINE friend FString operator+ ( const FString &  Lhs,
const TCHAR *  Rhs 
)
friend

Concatenates an FString to a TCHAR array.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe TCHAR array on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [4/10]

FORCEINLINE friend FString operator+ ( const FString &  Lhs,
FString &&  Rhs 
)
friend

Concatenate two FStrings.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [5/10]

FORCEINLINE friend FString operator+ ( const TCHAR *  Lhs,
const FString &  Rhs 
)
friend

Concatenates a TCHAR array to an FString.

参数
LhsThe TCHAR array on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [6/10]

FORCEINLINE friend FString operator+ ( const TCHAR *  Lhs,
FString &&  Rhs 
)
friend

Concatenates a TCHAR array to an FString.

参数
LhsThe TCHAR array on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [7/10]

template<typename CharType >
FORCEINLINE friend TEnableIf< TIsCharType< CharType >::Value, FString >::Type operator+ ( FString &&  Lhs,
CharType  Rhs 
)
friend

Concatenates an FString with a TCHAR.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe char on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [8/10]

FORCEINLINE friend FString operator+ ( FString &&  Lhs,
const FString &  Rhs 
)
friend

Concatenate two FStrings.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [9/10]

FORCEINLINE friend FString operator+ ( FString &&  Lhs,
const TCHAR *  Rhs 
)
friend

Concatenates an FString to a TCHAR array.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe TCHAR array on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator+ [10/10]

FORCEINLINE friend FString operator+ ( FString &&  Lhs,
FString &&  Rhs 
)
friend

Concatenate two FStrings.

参数
LhsThe FString on the left-hand-side of the expression.
RhsThe FString on the right-hand-side of the expression.
返回
The concatenated string.

◆ operator/ [1/5]

FORCEINLINE friend FString operator/ ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Concatenate this path with given path ensuring the / character is used between them

参数
LhsPath to concatenate onto.
RhsPath to concatenate.
返回
new FString of the path

◆ operator/ [2/5]

FORCEINLINE friend FString operator/ ( const FString &  Lhs,
const TCHAR *  Rhs 
)
friend

Concatenate this path with given path ensuring the / character is used between them

参数
LhsPath to concatenate onto.
RhsPath to concatenate.
返回
new FString of the path

◆ operator/ [3/5]

FORCEINLINE friend FString operator/ ( const TCHAR *  Lhs,
const FString &  Rhs 
)
friend

Concatenate this path with given path ensuring the / character is used between them

参数
LhsPath to concatenate onto.
RhsPath to concatenate.
返回
new FString of the path

◆ operator/ [4/5]

FORCEINLINE friend FString operator/ ( FString &&  Lhs,
const FString &  Rhs 
)
friend

Concatenate this path with given path ensuring the / character is used between them

参数
LhsPath to concatenate onto.
RhsPath to concatenate.
返回
new FString of the path

◆ operator/ [5/5]

FORCEINLINE friend FString operator/ ( FString &&  Lhs,
const TCHAR *  Rhs 
)
friend

Concatenate this path with given path ensuring the / character is used between them

参数
LhsPath to concatenate onto.
RhsPath to concatenate.
返回
new FString of the path

◆ operator< [1/3]

template<typename CharType >
FORCEINLINE friend bool operator< ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is < the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically < the right string, otherwise false
注解
case insensitive

◆ operator< [2/3]

template<typename CharType >
FORCEINLINE friend bool operator< ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is < the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically < the right string, otherwise false
注解
case insensitive

◆ operator< [3/3]

FORCEINLINE friend bool operator< ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is < the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically < the right string, otherwise false
注解
case insensitive

◆ operator<<

CORE_API FArchive & operator<< ( FArchive &  Ar,
FString &  S 
)
friend

Serializes the string.

参数
ArReference to the serialization archive.
SReference to the string being serialized.
返回
Reference to the Archive after serialization.

◆ operator<= [1/3]

template<typename CharType >
FORCEINLINE friend bool operator<= ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is <= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically <= the right string, otherwise false
注解
case insensitive

◆ operator<= [2/3]

template<typename CharType >
FORCEINLINE friend bool operator<= ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is <= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically <= the right string, otherwise false
注解
case insensitive

◆ operator<= [3/3]

FORCEINLINE friend bool operator<= ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is <= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically <= the right string, otherwise false
注解
case insensitive

◆ operator== [1/3]

template<typename CharType >
FORCEINLINE friend bool operator== ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is == the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically == the right string, otherwise false
注解
case insensitive

◆ operator== [2/3]

template<typename CharType >
FORCEINLINE friend bool operator== ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is == the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically == the right string, otherwise false
注解
case insensitive

◆ operator== [3/3]

FORCEINLINE friend bool operator== ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is == the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically == the right string, otherwise false
注解
case insensitive

◆ operator> [1/3]

template<typename CharType >
FORCEINLINE friend bool operator> ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is > the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically > the right string, otherwise false
注解
case insensitive

◆ operator> [2/3]

template<typename CharType >
FORCEINLINE friend bool operator> ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is > the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically > the right string, otherwise false
注解
case insensitive

◆ operator> [3/3]

FORCEINLINE friend bool operator> ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is > the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically > the right string, otherwise false
注解
case insensitive

◆ operator>= [1/3]

template<typename CharType >
FORCEINLINE friend bool operator>= ( const CharType *  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is >= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically >= the right string, otherwise false
注解
case insensitive

◆ operator>= [2/3]

template<typename CharType >
FORCEINLINE friend bool operator>= ( const FString &  Lhs,
const CharType *  Rhs 
)
friend

Lexicographically test whether the left string is >= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically >= the right string, otherwise false
注解
case insensitive

◆ operator>= [3/3]

FORCEINLINE friend bool operator>= ( const FString &  Lhs,
const FString &  Rhs 
)
friend

Lexicographically test whether the left string is >= the right string

参数
LhsString to compare against.
RhsString to compare against.
返回
true if the left string is lexicographically >= the right string, otherwise false
注解
case insensitive

该类的文档由以下文件生成: