How to convert Java String to Char array

Use String.toCharArray() method to convert string to array of charactors.

Example

package com.pretech;
public class StringToCharArray {
	public static void main(String[] args) {
		char[] mycharArray = "Welcome to my blog".toCharArray();
		System.out.println(mycharArray);
		
	}
}

No comments:

Post a Comment

Confusion Matrix + Precision/Recall (Super Simple, With Examples)

  Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...

Featured Posts