auto static method
Automatically replaces characters based on predefined replacement rules.
Parameters:
value
: The input string to perform replacements on.
Example:
String result = Replacement.auto("Hello! How are you?");
print(result); // Output: 'Hello How are you'
Implementation
static String auto(String value, [String? replacement]) {
for (int index = 0; index < value.length; index++) {
for (String reg in Regex.none) {
value = value.replaceAll(reg, replacement ?? "");
}
for (String s in Regex.slash) {
value = value.replaceAll(s, replacement ?? "_");
}
}
return value;
}