Java Char Array Create toCharacterArray(String s)

Here you can find the source of toCharacterArray(String s)

Description

to Character Array

License

GNU General Public License

Declaration

private static Character[] toCharacterArray(String s) 

Method Source Code

//package com.java2s;
/******************************************************************
 *   License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html   *
 *   Copyright (c) 2016 {slash.bin /bin} http://slashb.in         *
 ******************************************************************/

public class Main {
    private static Character[] toCharacterArray(String s) {
        if (s == null)
            return null;

        final Character[] c = new Character[s.length()];
        for (int i = 0; i < c.length; i++) {
            c[i] = s.charAt(i);/*from  w w  w .  j  a  v  a2s  .  c  o  m*/
        }
        return c;
    }
}

Related

  1. charArray(int arraySize)
  2. charArrayLiteral(CharSequence cs)
  3. toCharArray(boolean[] array)
  4. toCharArray(byte[] barr)
  5. toCharArray(byte[] byteArray)
  6. toCharArray(byte[] data)