2 *******************************************************************************
4 * Copyright (C) 1999-2011, International Business Machines
5 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: unistr_props.cpp
10 * tab size: 8 (not used)
13 * created on: 2004aug25
14 * created by: Markus W. Scherer
16 * Character property dependent functions moved here from unistr.cpp
19 #include "unicode/utypes.h"
20 #include "unicode/uchar.h"
21 #include "unicode/unistr.h"
22 #include "unicode/utf16.h"
33 UChar *array = getArrayStart();
35 int32_t oldLength = this->length();
36 int32_t i = oldLength, length;
38 // first cut off trailing white space
44 U16_PREV(array, 0, i, c);
45 if(!(c == 0x20 || u_isWhitespace(c))) {
49 if(length < oldLength) {
53 // find leading white space
61 U16_NEXT(array, i, length, c);
62 if(!(c == 0x20 || u_isWhitespace(c))) {
67 // move string forward over leading white space
69 doReplace(0, start, 0, 0, 0);