Simplified Conversion based on typical use of getting AT&T style RESTful Error Messages
@param text
@param vars
@return
169187
public static String convert(final String text, final List<String> vars) {
		String[] array = new String[vars.size()];
		StringBuilder sb = new StringBuilder();
		convert(sb,text,vars.toArray(array));
		return sb.toString();
	}
955083
static String[] splitOnTokens(final String text) {
        // used by wildcardMatch
        // package level so a unit test may run on this

        if (text.indexOf('?') == NOT_FOUND && text.indexOf('*') == NOT_FOUND) {
            return new String[] { text };
        }

        final char[] array = text.toCharArray();
        final ArrayList<String> list = new ArrayList<String>();
        final StringBuilder buffer = new StringBuilder();
        char prevChar = 0;
        for (int i = 0; i < array.length; i++) {
            final char ch = array[i];
            if (ch == '?' || ch == '*') {
                if (buffer.length() != 0) {
                    list.add(buffer.toString());
                    buffer.setLength(0);
                }
                if (ch == '?') {
                    list.add("?");
                } else if (prevChar != '*') {// ch == '*' here; check if previous char was '*'
                    list.add("*");
                }
            } else {
                buffer.append(ch);
            }
            prevChar = ch;
        }
        if (buffer.length() != 0) {
            list.add(buffer.toString());
        }

        return list.toArray(new String[list.size()]);
    }
1117428
public static Number parseNumber(final String text) throws ParseException
    {
        return context.get().getRuleBasedNumberFormat(RuleBasedNumberFormat.SPELLOUT).parse(text);
    }
1098055
public static String trimAndNullIfEmpty(final String text) {
        if (text != null && !text.trim().isEmpty()) {
            return text.trim();
        }
        return null;
    }
312471
public static List<Sentence> splitSentences(CharSequence text) {
    return JavaConversions.seqAsJavaList(
        TwitterKoreanProcessor.splitSentences(text)
    );
  }
12674
public static String processConfigValue(CharSequence text) {
    final String pv = evaluate(tokenReplaceSysProps(text));
    return (pv==null || pv.trim().isEmpty()) ? null : pv;
  }
1358365
public TextMatchBinding setText(
                    final Collection<String> text
                    )
    {
        if (text == null  ||  text.size() == 0) {
            clearText();
            return this;
        }

        synchronized (text) {
            for (String  pattern : text) {
                if (pattern == null  ||  pattern.length() == 0) {
                    throw new IllegalArgumentException( "null element" );
                }
            }

            clearText();
            for (String  pattern : text) {
                addText( pattern );
            }
        }

        return this;
    }
602327
public String convert(String text){
		String ret = text;
		
		if (cpsUni2Uni == null) return ret;
		
		Iterator<String> it = cpsUni2Uni.keySet().iterator();
		while(it.hasNext()){
			String cpsChar = it.next();
			ret = ret.replaceAll(cpsChar, cpsUni2Uni.get(cpsChar));
		}
		
		return ret;
		
	}
519894
public static String titleize(final String text, final String[] intCaps)
    {
        String str = text.toLowerCase(Locale.ENGLISH).replaceAll("[\\s_]+", SPACE).trim();
        return titleize(str, SPACE, intCaps);
    }
986736
public static VersionNumber parseLastVersionNumber(@Nonnull final String text) {
		Check.notNull(text, "text");

		final Matcher matcher = VERSIONNUMBER_WITH_SUFFIX.matcher(text);
		String[] split = null;
		String ext = null;
		while (matcher.find()) {
			split = matcher.group(MAJOR_INDEX).split("\\.");
			ext = matcher.group(EXTENSION_INDEX);
		}

		final String extension = ext == null ? VersionNumber.EMPTY_EXTENSION : trimRight(ext);

		return split == null ? VersionNumber.UNKNOWN : new VersionNumber(Arrays.asList(split), extension);
	}
736128
public static byte[] convertUtf16UnitsToUtf8(String text)
    {
        byte[] data = new byte[4*text.length()];
        int limit = 0;
        for (int i = 0; i < text.length(); i++)
        {
            char c = text.charAt(i);
            limit += IonUTF8.convertToUTF8Bytes(c, data, limit,
                                                data.length - limit);
        }

        byte[] result = new byte[limit];
        System.arraycopy(data, 0, result, 0, limit);
        return result;
    }
913911
public List<Hit<V>> parseText(String text)
    {
        int position = 1;
        int currentState = 0;
        List<Hit<V>> collectedEmits = new LinkedList<Hit<V>>();
        for (int i = 0; i < text.length(); ++i)
        {
            currentState = getState(currentState, text.charAt(i));
            storeEmits(position, currentState, collectedEmits);
            ++position;
        }

        return collectedEmits;
    }
70525
private static Variable[] litsAsVars(final Literal[] lits) {
    final Variable[] vars = new Variable[lits.length];
    for (int i = 0; i < vars.length; i++)
      vars[i] = lits[i].variable();
    return vars;
  }
244903
@POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.APPLICATION_JSON)
    public static Collection<Utterance> mapText(final String text)
            throws IOException, InterruptedException, JAXBException, SQLException, ParserConfigurationException,
                   SAXException {
        return mapTextWithOptions(new AnalysisRequest(text));
    }
282176
public static <T> String get(Message<T> text, T context) {
        for (AlternativeUiTextProvider p : all()) {
            String s = p.getText(text, context);
            if (s!=null)
                return s;
        }
        return null;
    }
660391
private static Long parseLong(final String text) {
		if (text.length() == 0) {
			return null;
		} else {
			try {
				return Long.parseLong(text);
			} catch (NumberFormatException ex) {
				return null;
			}
		}
	}
464093
public static String normalize( String text ) {
        CheckArg.isNotNull(text, "text");
        // This could be much more efficient.
        return NORMALIZE_PATTERN.matcher(text).replaceAll(" ").trim();
    }