answersLogoWhite

0

The string class has a split() method which takes a regex pattern and splits the string and returns an array.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Anyone knows a programming code to look for nth word in a string using string.h?

Function strtok can help you to separate the words.


Help using java want to split up a string and print out the individual word but also want to remove punctuation for example helloslashhow slashareslashyou reads to be hello how are you?

There are two ways to split a string into Java: 1) Using Split method 2) Using StringTokenizer Split method uses regular expression, so its more powerful and flexible.


How do you copy a string from one method into another string in another method in java?

You can have two String variables (note that String variables are object references) refer to the same String object like so: String str1 = "Hello"; String str2 = str1; Now the str1 and str2 are references for the same String object containing the word "Hello". If you actually want a new String object with a copy of the contents of the original String, you use the String constructor that takes a String argument, like so: String str3 = new String(str1); Now str1 and str3 refer to SEPARATE String objects that happen to contain the same sequence of characters (the word "Hello"). Since Strings objects in Java are immutable, they can be shared without worrying about the contents used by one variable being upset by the use through another variable as might happen with char[] arrays in C or C++ so the first method is probably sufficient for most cases.


What is a sentence using the word string?

The kitten will play with the piece of string for hours on end.


How do you except a string in place of an integer in python?

A string is placed between quotes, while integers are not quoted. If a string is not quoted, the computer will read each word as a separate filename instead of being a single string.


How do you count words in a paragraph using string?

use Microsoft word


How do you use the Scanner class to store two words or more in a String variable then the next input in another String variable in java?

Scanner scan = new Scanner("[input method]"); // input method could they key board //(System.in) or a String String one = scan.next() + scan.next(); // get the first 2 words and concatenate String two = scan.next(); // the remaining word


What is a sentence using the word method?

Method iS a way to show manner By:jocelyn aguirre


What does verbal method mean in math?

it is the method that use to discribe the set using word


What phrase begins with the word string?

String him along is a saying. It begins with the word string.


Write a Java Program to find occurences of given word in a text?

Check the documentation of the String class, for a method that searches for a substring.


Could you give example sentences using the word string?

The Hawaiian Islands could be described as string of islands. A random string of notes does not make a tune.