1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | public class SentenceToWord { public static void main(String[] args) { String a = new String("My name is Shadhin"); String[] words = a.split("\\s+"); for (int i = 0; i < words.length; i++) { System.out.println(words[i] + " "); } } } |
Wednesday, April 27, 2016
Converting a sentence string to a string array of words in Java
Subscribe to:
Post Comments (Atom)
php4
<?php // Start the session session_start(); ?> <!DOCTYPE html> <html> <head> <link rel=&q...
No comments:
Post a Comment