About 16,300,000 results
Open links in new tab
  1. Converting a sentence string to a string array of words in Java

    Jan 13, 2011 · String s = "This is a sample sentence"; String[] words = s.split(" "); this will make an array with elements as the string separated by " ".

  2. String Arrays in Java - GeeksforGeeks

    Nov 25, 2024 · When we create an array of type String in Java, it is called a String Array in Java. In this article, we will learn the concepts of String Arrays in Java including declaration, …

  3. Java Strings - W3Schools

    A String in Java is actually an object, which contain methods that can perform certain operations on strings. For example, the length of a string can be found with the length() method: Example

  4. Strings (The Java™ Tutorials > Learning the Java Language - Oracle

    In the Java programming language, strings are objects. The Java platform provides the String class to create and manipulate strings. The most direct way to create a string is to write: String …

  5. Split string into individual words Java - Stack Overflow

    Jul 30, 2012 · You can use split(" ") method of the String class and can get each word as code given below: String s = "I want to walk my dog"; String []strArray=s.split(" "); for(int i=0; …

  6. Java String - working with strings in Java using String and

    Jul 4, 2024 · In this article we show how to work with strings in Java using String and StringBuilder. In Java, a string is a sequence of Unicode characters. Strings are objects. There …

  7. Java Strings - GeeksforGeeks

    May 6, 2025 · Ways of Creating a Java String. There are two ways to create a string in Java: String Literal; Using new Keyword; Syntax: <String_Type> <string_variable> = …

  8. Java Strings: Creating and Manipulating Text - CodeLucky

    Aug 31, 2024 · The simplest way to create a String is by using string literals: String greeting = "Hello, World!"; Java stores string literals in a special memory area called the "String Pool" for …

  9. Wrapping a String After a Number of Characters Word-Wise

    Jan 8, 2024 · In this tutorial, we’ll see how to wrap a sentence automatically after a given number of characters. Hence, our program will return a transformed String with new line breaks. 2. …

  10. Java String - Jenkov.com

    Apr 29, 2020 · A Java String is a sequence of characters which make up a textual code, name, sentence or whatever else you need to represent with characters. Java Strings are …