Java String Case Insert inverterString(String palavra)

Here you can find the source of inverterString(String palavra)

Description

inverter String

License

Open Source License

Declaration

public static String inverterString(String palavra) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String inverterString(String palavra) {
        if (isEmpty(palavra))
            return "";
        String[] letras = palavra.split("");
        int ultimoValor = letras.length - 1;
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i <= ultimoValor; i++) {
            stringBuilder.append(letras[ultimoValor - i]);
        }//from  w w  w .  j a v a 2s.co  m
        return stringBuilder.toString();
    }

    public static boolean isEmpty(String palavra) {
        if (palavra == null)
            return true;
        return palavra.trim().length() == 0;
    }
}

Related

  1. invertCase(String line)
  2. invertCase(String str)
  3. invertDate(String sDate)
  4. inverter(String str)
  5. inverter(String string)
  6. invertHostName(String hostNameIn)
  7. invertKanaCase(String result)
  8. invertString(String s)