src/net/sourceforge/plantuml/StringUtils.java
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import net.sourceforge.plantuml.utils.Direction;

// Do not move
public class StringUtils {

	public static String goUpperCase(String s) {
		 return s.toUpperCase();
	}

	public static String goLowerCase(String s) {
		 return s.toLowerCase();
	}

	public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s, String format) {
		if (s == null)
			return null;

		if (format.contains("\"") && s.length() > 1 && isDoubleQuote(s.charAt(0))
				&& isDoubleQuote(s.charAt(s.length() - 1)))
			return s.substring(1, s.length() - 1);

		if (format.contains("(") && s.startsWith("(") && s.endsWith(")"))
			return s.substring(1, s.length() - 1);

		if (format.contains("[") && s.startsWith("[") && s.endsWith("]"))
			return s.substring(1, s.length() - 1);

		if (format.contains(":") && s.startsWith(":") && s.endsWith(":"))
			return s.substring(1, s.length() - 1);

		return s;
	}

	public static String eventuallyRemoveStartingAndEndingDoubleQuote(String s) {
		if (s == null)
			return s;

		return eventuallyRemoveStartingAndEndingDoubleQuote(s, "\"([:");
	}

	private static boolean isDoubleQuote(char c) {
		return c == '\"' || c == '\u201c' || c == '\u201d' || c == '\u00ab' || c == '\u00bb';
	}


	public static String sharp000000(int color) {
		final int v = 0xFFFFFF & color;
		String s = "000000" + Integer.toHexString(v).toUpperCase();
		s = s.substring(s.length() - 6);
		return "#" + s;
	}


	// http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html
}
