aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino')
-rw-r--r--cores/arduino/WString.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp
index e4bed03..f494094 100644
--- a/cores/arduino/WString.cpp
+++ b/cores/arduino/WString.cpp
@@ -684,8 +684,10 @@ void String::replace(const String& find, const String& replace)
}
void String::remove(unsigned int index){
- int count = len - index;
- remove(index, count);
+ // Pass the biggest integer as the count. The remove method
+ // below will take care of truncating it at the end of the
+ // string.
+ remove(index, (unsigned int)-1);
}
void String::remove(unsigned int index, unsigned int count){