diff --git a/lime/text/UTF8String.hx b/lime/text/UTF8String.hx index c39c5973b..d96f9c451 100644 --- a/lime/text/UTF8String.hx +++ b/lime/text/UTF8String.hx @@ -174,6 +174,12 @@ abstract UTF8String(String) from String to String { **/ public function substr (pos:Int, ?len:Int):String { + if (len == null) { + + len = (this:UTF8String).length - pos; + + } + return Utf8.sub (this, pos, len); }