aboutsummaryrefslogtreecommitdiff
path: root/common/str.cpp
diff options
context:
space:
mode:
authorMax Horn2003-10-08 21:01:50 +0000
committerMax Horn2003-10-08 21:01:50 +0000
commitcf3ac50e3c76e3aa0d9e5c30ba4e83e6a4c4d85d (patch)
treeda55af884487280e2060cdd3c50207bffe9bb7b8 /common/str.cpp
parentb41c052ab5b117ca236fd1ea48c9fe7dbe671575 (diff)
downloadscummvm-rg350-cf3ac50e3c76e3aa0d9e5c30ba4e83e6a4c4d85d.tar.gz
scummvm-rg350-cf3ac50e3c76e3aa0d9e5c30ba4e83e6a4c4d85d.tar.bz2
scummvm-rg350-cf3ac50e3c76e3aa0d9e5c30ba4e83e6a4c4d85d.zip
add String::lastChar() method
svn-id: r10684
Diffstat (limited to 'common/str.cpp')
-rw-r--r--common/str.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/str.cpp b/common/str.cpp
index 416b4d828f..0d2d3613f5 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -140,6 +140,10 @@ String &String::operator += (char c) {
return *this;
}
+char lastChar() const {
+ return (_len > 0) ? _str[_len-1] : 0;
+}
+
void String::deleteLastChar() {
if (_len > 0) {
ensureCapacity(_len - 1, true);