]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/patternprops.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / common / patternprops.cpp
index b2c524998667e3d78c760b31e6610fcec93b2ac0..c38a7e276def15b815666193709d08f2eeddca32 100644 (file)
@@ -1,10 +1,12 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *   Copyright (C) 2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *******************************************************************************
 *   file name:  patternprops.cpp
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
@@ -171,6 +173,16 @@ PatternProps::skipWhiteSpace(const UChar *s, int32_t length) {
     return s;
 }
 
+int32_t
+PatternProps::skipWhiteSpace(const UnicodeString& s, int32_t start) {
+    int32_t i = start;
+    int32_t length = s.length();
+    while(i<length && isWhiteSpace(s.charAt(i))) {
+        ++i;
+    }
+    return i;
+}
+
 const UChar *
 PatternProps::trimWhiteSpace(const UChar *s, int32_t &length) {
     if(length<=0 || (!isWhiteSpace(s[0]) && !isWhiteSpace(s[length-1]))) {