normalizeID static method

String normalizeID(
  1. String id
)

Normalizes the id.

Substitutes \W by _ (trimmed).

Implementation

static String normalizeID(String id) {
  id = id.replaceAll(_regExpNonWord, '_');
  if (id.startsWith('_')) id = id.substring(1);
  if (id.endsWith('_')) id = id.substring(0, id.length - 1);
  return id;
}