sanitizeString static method
Sanitize string input by trimming and removing control characters.
Removes leading/trailing whitespace and control characters that could cause issues. This helps prevent injection attacks and ensures clean input data.
Parameters
input
: The string to sanitize
Returns
A sanitized string with whitespace trimmed and control characters removed.
Implementation
static String sanitizeString(String input) {
return input.trim().replaceAll(RegExp(r'[\x00-\x1F\x7F-\x9F]'), '');
}