mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-26 12:21:23 +00:00
Initial Move from Azure DevOps to GitHub
This commit is contained in:
21
src/Utils/StringUtils.ts
Normal file
21
src/Utils/StringUtils.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export class StringUtils {
|
||||
public static stripSpacesFromString(inputString: string): string {
|
||||
if (inputString == null || typeof inputString !== "string") {
|
||||
return inputString;
|
||||
}
|
||||
return inputString.replace(/ /g, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of endsWith which works for IE
|
||||
* @param stringToTest
|
||||
* @param suffix
|
||||
*/
|
||||
public static endsWith(stringToTest: string, suffix: string): boolean {
|
||||
return stringToTest.indexOf(suffix, stringToTest.length - suffix.length) !== -1;
|
||||
}
|
||||
|
||||
public static startsWith(stringToTest: string, prefix: string): boolean {
|
||||
return stringToTest.indexOf(prefix) === 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user