Here you can find the source of toCharArray(String str)
Parameter | Description |
---|---|
str | a string |
public static char[] toCharArray(String str)
//package com.java2s; /*//from ww w.j av a2s . co m * Helma License Notice * * The contents of this file are subject to the Helma License * Version 2.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://adele.helma.org/download/helma/license.txt * * Copyright 1998-2003 Helma Software. All Rights Reserved. * * $RCSfile$ * $Author$ * $Revision$ * $Date$ */ public class Main { /** * Get the character array for a string. Useful for use from * Rhino, where the Java String methods are not readily available * without constructing a new String instance. * @param str a string * @return the char array */ public static char[] toCharArray(String str) { return str == null ? new char[0] : str.toCharArray(); } }