int index;  for (index = start; index < end; index++) { char c = string.charAt(index); if (c == '}' || c == '{' || c == '\\') { break;
for (int index = start; index < end; index++) { char ch = string.charAt(index); if (ch > 0xFF && WriteUnicode) {   if (index > start) { write(string.substring(start, index)); } write("\\u"); write(Integer.toString((short) ch)); write(' '); start = index + 1; } else if (ch == '}' || ch == '{' || ch == '\\') {   if (index > start) { write(string.substring(start, index)); } write('\\'); write(ch); start = index + 1;
	void write(String string, int start, int end) {		int index;				for (index = start; index < end; index++) {			char c = string.charAt(index);			if (c == '}' || c == '{' || c == '\\') {				break;			}		}		if (index == end) {			write(string.substring(start, end));	// string doesn't contain RTF formatting characters, write as is		}		else {										// string needs to be transformed			char[] text = new char[end - start];						string.getChars(start, end, text, 0);			for (index = 0; index < text.length; index++) {				switch (text[index]) {					case '}':					case '{':					case '\\':						write("\\");					default:						write(text[index]);				}						}					}	}	