Skip to content

Instantly share code, notes, and snippets.

@mikeerickson
Created July 19, 2018 18:50
Show Gist options
  • Save mikeerickson/edbb6d7bf1ebe006629d1cbb1346fb45 to your computer and use it in GitHub Desktop.
Save mikeerickson/edbb6d7bf1ebe006629d1cbb1346fb45 to your computer and use it in GitHub Desktop.
StringUtils (TypeScript)
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