using the 'split' method in java using 2 or more spaces as a delimiter
Copy this code and paste it in your HTML
String str
="This is my Red house"; String[] result
=str.
split(" +");
for (int i=0;i<result.length;i++)
{
System.
out.
println("The result is ==== "+result
[i
]);
}
Report this snippet
Comments
Subscribe to comments