Currently in my Angular 5 project, I am encountering an issue with using the .trim() function in TypeScript on a string. Despite implementing it as shown below, no whitespace is being removed and also there are no error messages appearing:
this.maintabinfo = this.inner_view_data.trim().toLowerCase();
// inner_view_data has this value = "Stone setting"
The documentation at https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-4.html explicitly states that .trim()
is supported in TypeScript.
What would be the most effective approach to eliminate whitespace from a string in TypeScript?