shtuff
This commit is contained in:
@@ -27,8 +27,8 @@ class NameBeautify {
|
||||
stopName = stopName.replaceAll(RegExp(r'\>.*\<'), '');
|
||||
|
||||
|
||||
// remove any special characters except & and /
|
||||
stopName = stopName.replaceAll(RegExp(r'[^a-zA-Z0-9&/ ]'), '');
|
||||
// remove any special characters except & and / and -
|
||||
stopName = stopName.replaceAll(RegExp(r'[^a-zA-Z0-9&\/\- ]'), '');
|
||||
|
||||
// remove any double spaces
|
||||
stopName = stopName.replaceAll(RegExp(r' '), ' ');
|
||||
@@ -41,12 +41,17 @@ class NameBeautify {
|
||||
stopName = stopName.replaceAll(RegExp(phrase, caseSensitive: false), Longify[phrase]!);
|
||||
}
|
||||
|
||||
// remove any spaces at the start or end of the string
|
||||
stopName = stopName.trim();
|
||||
stopName = stopName.replaceAll(' ', ' ');
|
||||
|
||||
stopName = stopName.toLowerCase();
|
||||
// Capitalify the first letter of each word
|
||||
try {
|
||||
stopName = stopName.split(' ').map((word) => word[0].toUpperCase() + word.substring(1)).join(' ');
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
print("Error capitalifying stop name: $stopName");
|
||||
}
|
||||
|
||||
return stopName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user