codedungeon
7/19/2018 - 6:50 PM

StrUtils.ts

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;
  }
}