code: @Nullable
    public static String getAsIdentifier (@Nullable final String s, @Nonnull final String sReplacement)
    {
      ValueEnforcer.notNull (sReplacement, "Replacement");
  
      if (StringHelper.hasNoText (s))
        return s;
  
      // replace all non-word characters with the replacement character
      // Important: replacement does not need to be quoted, because it is not
      // treated as a regular expression!
      final String ret = stringReplacePattern ("\\W", s, sReplacement);
      if (ret.length () == 0)
        return sReplacement;
      if (!Character.isJavaIdentifierStart (ret.charAt (0)))
        return sReplacement + ret;
      return ret;
    }
docs: Convert an identifier to a programming language identifier by replacing all
  non-word characters with an underscore.
  
  @param s
  The string to convert. May be <code>null</code> or empty.
  @param sReplacement
  The replacement string to be used for all non-identifier characters.
  May be empty but not be <code>null</code>.
  @return The converted string or <code>null</code> if the input string is
  <code>null</code>. Maybe an invalid identifier, if the replacement
  is empty, and the identifier starts with an illegal character, or
  if the replacement is empty and the source string only contains
  invalid characters!