MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / join

Method join

src/main/java/com/rtg/util/StringUtils.java:290–299  ·  view source on GitHub ↗

Joins a string array into a String. @param delim the delimiter to insert between values @param array the array to join @param quoteStringsWithSpaces whether to surround strings that contain spaces with quotes or not @return the string elements joined by the delimiter

(final String delim, final String[] array, final boolean quoteStringsWithSpaces)

Source from the content-addressed store, hash-verified

288 * @return the string elements joined by the delimiter
289 */
290 public static String join(final String delim, final String[] array, final boolean quoteStringsWithSpaces) {
291 final StringBuilder sb = new StringBuilder();
292 for (int i = 0; i < array.length; ++i) {
293 if (i != 0 && delim != null) {
294 sb.append(delim);
295 }
296 sb.append(quoteStringsWithSpaces ? smartQuote(array[i]) : array[i]);
297 }
298 return sb.toString();
299 }
300
301 /**
302 * Joins a string array into a String.

Callers 15

createRecordMethod · 0.95
testJoin3Method · 0.95
testJoin2Method · 0.95
testJoinMethod · 0.95
testJoinEmptyMethod · 0.95
mergeIdsMethod · 0.95
toStringMethod · 0.95
additionalChecksMethod · 0.95
addInfoMethod · 0.95
setInfoMethod · 0.95
formatAltFieldMethod · 0.95
formatFormatFieldMethod · 0.95

Calls 4

smartQuoteMethod · 0.95
appendMethod · 0.65
toStringMethod · 0.65
valueOfMethod · 0.45

Tested by 5

createRecordMethod · 0.76
testJoin3Method · 0.76
testJoin2Method · 0.76
testJoinMethod · 0.76
testJoinEmptyMethod · 0.76