Program To display each Character seperatly from a string
import javax.swing.JOptionPane;
import org.apache.commons.lang3.StringUtils;
public class Display_each_char
{
public static void main(String[] args)
{
String sStr=JOptionPane.showInputDialog("Enetr some data");
for (int i=0 ;i<= sStr.length();i++)
{
System.out.println(StringUtils.mid(sStr, i, 1));
}
}
}
No comments:
Post a Comment