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
Recommended Articles
- Java Problem
Write a program for Bubble Sort in javaApr 27, 2016
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 import java.util.Scanner; public class BubbleSort { pu...
- Java Problem
Converting a sentence string to a string array of words in JavaApr 27, 2016
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 ...
Newer Article
Write a program for Bubble Sort in java
Older Article
Frequently asked question in Android
Labels:
Java Problem
Subscribe to:
Post Comments (Atom)
php4
<?php // Start the session session_start(); ?> <!DOCTYPE html> <html> <head> <link rel=...
No comments:
Post a Comment