Convert the string for use in HTML or URLs.

@param delimiter a spacer string to add
@param input unescaped string.
@return the escaped string.
190730
public static final String escapeString(final String delimiter,
            final String input) {
        final String escaped = escapeString(input);
        if (escaped.isEmpty()) {
            return escaped;
        }
        return delimiter + escaped;
    }
736021
public CsvReader lineDelimiter(String delimiter) {
		if (delimiter == null || delimiter.length() == 0) {
			throw new IllegalArgumentException("The delimiter must not be null or an empty string");
		}

		this.lineDelimiter = delimiter;
		return this;
	}
1028406
@NotNull
    public static String[] toArrayWithEscaped(@Nullable final String stringArray, @NotNull final String delimiter) {
        if (StringUtils.isEmpty(stringArray)) {
            return new String[0];
        }
        return StringUtils.splitByWholeSeparatorPreserveAllTokens(stringArray, delimiter);
    }
389021
public static String[] tokenize(String str, String delimiters) {
        return tokenize(str, delimiters, false);
    }
517501
public static String toPlain(String input) {
        Matcher matcher = SPACE_PATTERN.matcher(input);
        if (matcher.find()) {
            return matcher.replaceAll("");
        } else {
            return input;
        }
    }
23510
public String convertToJavaString(String input, boolean useUnicode) {
		int length = input.length();
		StringBuilder result = new StringBuilder(length + 4);
		for (int i = 0; i < length; i++) {
			escapeAndAppendTo(input.charAt(i), useUnicode, result);
		}
		return result.toString();
	}
181858
public static String[] split(String input, char delimiter) {
        return split(input, String.valueOf(delimiter));
    }
964155
@SuppressWarnings("checkstyle:cyclomaticcomplexity")
    private static String escapeString(final String str) {
        final StringBuilder sb = new StringBuilder(str.length());

        for (final char ch : str.toCharArray()) {
            switch (ch) {
                case QUOTE:
                case '\\':
                case '/':
                    sb.append('\\');
                    sb.append(ch);
                    break;
                case '\b':
                    sb.append("\\b");
                    break;
                case '\f':
                    sb.append("\\f");
                    break;
                case '\n':
                    sb.append("\\n");
                    break;
                case '\r':
                    sb.append("\\r");
                    break;
                case '\t':
                    sb.append("\\t");
                    break;
                default:
                    sb.append(ch < ' ' ? escapeCharacter(ch) : ch);
            }
        }

        return sb.toString();
    }
226349
public static function strGetCsv($input, $delimiter = ',', $enclosure = '"', $escape = '"')
    {
        self::checkGetCsvEscape($enclosure, $escape);

        return \str_getcsv($input, $delimiter, $enclosure, $enclosure);
    }
806703
private static String caseFormatWithDelimiter(String str, String delimiter, boolean isAllUpper, boolean isAllLower) {
		StringBuilder builder = new StringBuilder(str.length());
		String[] tokens = NOT_ALPHANUMERIC_REGEX.split(str);
		boolean shouldAddDelimiter = StringUtils.isNotEmpty(delimiter);
		for (int i = 0; i < tokens.length; i++) {
			String currentToken = tokens[i];
			builder.append(currentToken);
			boolean hasNextToken = i + 1 != tokens.length;
			if (hasNextToken && shouldAddDelimiter) {
				builder.append(delimiter);
			}
		}
		String outputString = builder.toString();
		if (isAllLower) {
			return StringUtils.lowerCase(outputString);
		} else if (isAllUpper) {
			return StringUtils.upperCase(outputString);
		}
		return outputString;
	}
69758
public static void split(String input, char delimiter, Consumer<String> callbackPerSubstring) {
        if(input == null) throw new NullPointerException("input cannot be null");
        
        final int len = input.length();
        
        int lastMark = 0;
        for (int i = 0; i < len; i++) {
            if (input.charAt(i) == delimiter) {
                callbackPerSubstring.accept(input.substring(lastMark, i));
                lastMark = i + 1;// 1 == delimiter length
            }
        }
        callbackPerSubstring.accept(input.substring(lastMark, len));
    }
313443
private static String delimit(String s, char c) {
    int i = s.indexOf(c);
    while (i != -1) {
      if (i == 0 || s.charAt(i - 1) != '\\') {
        s = s.substring(0, i) + '\\' + s.substring(i);
        i = s.indexOf(c, i + 2);
      } else {
        i = s.indexOf(c, i + 1);
      }
    }
    return s;
  }
1001259
public static String implode(String[] inputArr, String delimiter) {
        String implodedStr = "";

        implodedStr += inputArr[0];
        for (int i = 1; i < inputArr.length; i++) {
            implodedStr += delimiter;
            implodedStr += inputArr[i];
        }
        return implodedStr;
    }
949295
function(scalar, delimiters, stringDelimiters, i, evaluate)
	{
		if ( delimiters == undefined ) delimiters = null;
		if ( stringDelimiters == undefined ) stringDelimiters = ['"', "'"];
		if ( i == undefined ) i = 0;
		if ( evaluate == undefined ) evaluate = true;
		
		var output = null;
		var pos = null;
		var matches = null;
		
		if ( this.inArray(scalar[i], stringDelimiters) )
		{
			// quoted scalar
			output = this.parseQuotedScalar(scalar, i);
			i = this.i;
			if (null !== delimiters) {
				var tmp = scalar.substr(i).replace(/^\s+/, '');
				if (!this.inArray(tmp.charAt(0), delimiters)) {
					throw new YamlParseException('Unexpected characters ('+scalar.substr(i)+').');
				}
			}
		}
		else
		{
			// "normal" string
			if ( !delimiters )
			{
				output = (scalar+'').substring(i);
				
				i += output.length;

				// remove comments
				pos = output.indexOf(' #');
				if ( pos != -1 )
				{
					output = output.substr(0, pos).replace(/\s+$/g,'');
				}
			}
			else if ( matches = new RegExp('^(.+?)('+delimiters.join('|')+')').exec((scalar+'').substring(i)) )
			{
				output = matches[1];
				i += output.length;
			}
			else
			{
				throw new YamlParseException('Malformed inline YAML string ('+scalar+').');
			}
			output = evaluate ? this.evaluateScalar(output) : output;
		}

		this.i = i;
		
		return output;
	}
678400
public static int delimiterOffset(String input, int pos, int limit, String delimiters) {
    for (int i = pos; i < limit; i++) {
      if (delimiters.indexOf(input.charAt(i)) != -1) return i;
    }
    return limit;
  }
764857
public static String escapeStringForJsRegexp(String input) {
    JsString string = uncheckedCast(input);
    return string.replace(ESCAPE_JS_STRING_REGEXP, "\\$&");
  }
471017
public static String concatenateAndUriEncode(Collection<?> list, String delimiter) {
        Collection<String> escaped = new ArrayList<String>();

        if (list != null) {
            for (Object object : list) {
                escaped.add(encode(object.toString()));
            }
        }
        return StringUtils.concatenate(escaped, delimiter);
    }