Created
July 19, 2018 18:50
-
-
Save mikeerickson/edbb6d7bf1ebe006629d1cbb1346fb45 to your computer and use it in GitHub Desktop.
StringUtils (TypeScript)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class StrUtils { | |
public static reverseString(value: string): string { | |
return value.split('').reverse().join(''); | |
} | |
public static revereStringLoop(str: string): string { | |
let result: string = ''; | |
for (let i: number = str.length - 1; i >= 0; i--) { | |
result += str[i]; | |
} | |
return result; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment