MCPcopy Create free account
hub / github.com/PCGen/pcgen / split

Method split

code/src/java/pcgen/core/utils/CoreUtility.java:317–333  ·  view source on GitHub ↗

Turn a 'separator' separated string into a ArrayList of strings, each corresponding to one trimmed 'separator'-separated portion of the original string. @param aString The string to be split @param separator The separator that separates the string. @return a List of Strings

(final String aString, final char separator)

Source from the content-addressed store, hash-verified

315 * @return a List of Strings
316 */
317 public static List<String> split(final String aString, final char separator)
318 {
319 final List<String> temp = new ArrayList<>();
320 final String sepStr = Pattern.quote(String.valueOf(separator));
321
322 if (aString.trim().isEmpty())
323 {
324 return temp;
325 }
326
327 for (final String s : Arrays.asList(aString.split(sepStr)))
328 {
329 temp.add(s.trim());
330 }
331
332 return temp;
333 }
334
335 /**
336 * Merge the equipment list

Callers 15

passesMethod · 0.95
returnNameMethod · 0.95
getUndecoratedNameMethod · 0.95
getEquipmentOfTypeMethod · 0.95
CharacterFilterMethod · 0.95
PatternFilterMethod · 0.95
splitInExStringMethod · 0.95
rollAttackFunction · 0.45
addTypeMethod · 0.45
parseForUnparseMethod · 0.45
convertMethod · 0.45

Calls 4

trimMethod · 0.80
isEmptyMethod · 0.65
addMethod · 0.65
valueOfMethod · 0.45

Tested by 6

passesMethod · 0.76
addTypeMethod · 0.36
parseForUnparseMethod · 0.36
convertMethod · 0.36
passesMethod · 0.36
passesMethod · 0.36