MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / replaceSpacesEtc

Method replaceSpacesEtc

ij/src/main/java/ij/gui/Plot.java:4406–4411  ·  view source on GitHub ↗

Convert a string to a label suitable for a ResultsTable without whitespace, quotes or commas, to avoid problems when saving and reading the table. Returns null if an empty string or null.

(String s)

Source from the content-addressed store, hash-verified

4404 /** Convert a string to a label suitable for a ResultsTable without whitespace, quotes or commas,
4405 * to avoid problems when saving and reading the table. Returns null if an empty string or null. */
4406 static String replaceSpacesEtc(String s) {
4407 if (s == null) return null;
4408 s = s.trim().replaceAll("[\\s,]", "_").replace("\"","''");
4409 if (s.length() == 0) return null;
4410 return s;
4411 }
4412
4413 /** get the number of digits for writing a column to the results table or the clipboard */
4414 static int getPrecision(float[] values) {

Callers 1

addToListsMethod · 0.95

Calls 4

replaceAllMethod · 0.80
lengthMethod · 0.65
replaceMethod · 0.45
trimMethod · 0.45

Tested by

no test coverage detected