From d526ddf7ae62ed15f75a116718951cd8206c2b6b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 23 Oct 2017 11:49:54 +0300 Subject: [PATCH] Extended FString class with functions to get first and last characters --- src/zstring.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zstring.h b/src/zstring.h index b6986361f..b30bef2dc 100644 --- a/src/zstring.h +++ b/src/zstring.h @@ -187,6 +187,9 @@ public: FString &operator << (char tail) { return *this += tail; } FString &operator << (const FName &name) { return *this += name.GetChars(); } + const char &Front() const { assert(IsNotEmpty()); return Chars[0]; } + const char &Back() const { assert(IsNotEmpty()); return Chars[Len() - 1]; } + FString Left (size_t numChars) const; FString Right (size_t numChars) const; FString Mid (size_t pos, size_t numChars = ~(size_t)0) const;