Here you can find the source of append(final String string, final String append, final String delimiter)
Parameter | Description |
---|---|
string | the string in front |
append | the string to append |
delimiter | the string that separates `string` and `append` |
public static String append(final String string, final String append, final String delimiter)
//package com.java2s; public class Main { /**/*from w w w . j av a 2 s . co m*/ * Appends the string `append` to `string` separated by the `delimiter` string. * * @param string * the string in front * @param append * the string to append * @param delimiter * the string that separates `string` and `append` * @return appended string of `string` + `delimiter` + `append`, or `null` if `string` if `string` is `null`. */ public static String append(final String string, final String append, final String delimiter) { if (string == null) { return append; } else { final StringBuilder builder = new StringBuilder(string); if (delimiter != null) builder.append(delimiter); if (append != null) builder.append(append); return builder.toString(); } } }