Java String Case Insert invert(final String s)

Here you can find the source of invert(final String s)

Description

invert

License

Open Source License

Declaration

public static String invert(final String s) 

Method Source Code

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

public class Main {
    public static String invert(final String s) {
        char[] cs = s.toCharArray();
        char[] result = new char[s.length()];
        int j = 0;
        int i = s.length() - 1;
        while (i >= 0) {
            result[j++] = cs[i--];/*  w  w w  .j av a 2 s. c o  m*/
        }
        return new String(result);
    }
}

Related

  1. invert(String s)
  2. invertCase(String line)
  3. invertCase(String str)
  4. invertDate(String sDate)