- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use Java String.split() method to split a string by dot?
The split() method of the String class is used to split the given string around matches of the given regular expression. To split a string by dot pass a dot by placing double escape characters as "\."
Example
public class Data { public static void main(String args[]) { String Str = new String("Welcome.to.Tutorialspoint.com"); System.out.println("Return Value :" ); for (String retval: Str.split("\.")) { System.out.println(retval); } } }
Output
Return Value : Welcome to Tutorialspoint com
- Related Articles
- Java Program to split a string with dot
- Split String with Dot (.) in Java
- How to use Java string replace method?
- How to split a string in Java?
- Java String split() method example.
- How can I use Python regex to split a string by multiple delimiters?
- How to split string by a delimiter string in Python?
- How to split a Java String into tokens with StringTokenizer?
- Java program to split and join a string
- How to Split String in Java using Regular Expression?
- How can we split a string by sentence as a delimiter in Java?
- How do we use a delimiter to split string in Python regular expression?
- Python Program to Split a String by Custom Lengths
- How to use the grep command to search for a string that has a dot in it?
- Split a string in Java

Advertisements