@@ -538,14 +538,14 @@ private UTF8String copyUTF8String(int start, int end) {
538538 public UTF8String trim () {
539539 int s = 0 ;
540540 // skip all of the space (0x20) in the left side
541- while (s < this .numBytes && getByte (s ) == 0x20 ) s ++;
541+ while (s < this .numBytes && getByte (s ) == ' ' ) s ++;
542542 if (s == this .numBytes ) {
543543 // Everything trimmed
544544 return EMPTY_UTF8 ;
545545 }
546546 // skip all of the space (0x20) in the right side
547547 int e = this .numBytes - 1 ;
548- while (e > s && getByte (e ) == 0x20 ) e --;
548+ while (e > s && getByte (e ) == ' ' ) e --;
549549 if (s == 0 && e == numBytes - 1 ) {
550550 // Nothing trimmed
551551 return this ;
@@ -557,7 +557,7 @@ public UTF8String trim() {
557557 * Trims whitespaces (<= ASCII 32) from both ends of this string.
558558 *
559559 * Note that, this method is the same as java's {@link String#trim}, and different from
560- * {@link UTF8String#trim()} which only remove only spaces(= ASCII 32) from both ends.
560+ * {@link UTF8String#trim()} which remove only spaces(= ASCII 32) from both ends.
561561 *
562562 * @return A UTF8String whose value is this UTF8String, with any leading and trailing white
563563 * space removed, or this UTF8String if it has no leading or trailing whitespace.
@@ -566,14 +566,14 @@ public UTF8String trim() {
566566 public UTF8String trimAll () {
567567 int s = 0 ;
568568 // skip all of the whitespaces (<=0x20) in the left side
569- while (s < this .numBytes && getByte (s ) <= 0x20 ) s ++;
569+ while (s < this .numBytes && getByte (s ) <= ' ' ) s ++;
570570 if (s == this .numBytes ) {
571571 // Everything trimmed
572572 return EMPTY_UTF8 ;
573573 }
574574 // skip all of the whitespaces (<=0x20) in the right side
575575 int e = this .numBytes - 1 ;
576- while (e > s && getByte (e ) <= 0x20 ) e --;
576+ while (e > s && getByte (e ) <= ' ' ) e --;
577577 if (s == 0 && e == numBytes - 1 ) {
578578 // Nothing trimmed
579579 return this ;
0 commit comments