013-004-007

Split String with Regex

Easy

Problem Description

Split String with Regex

In this problem, you will create a program that reads one line from standard input, splits it using the regex pattern [,;:] to recognize multiple delimiter types at once, and displays each resulting element to standard output.

Learning Objective: Understand string splitting with regex using String.split() method

Overview

Create a program that reads a string from standard input, splits it using a regex pattern, and outputs each part.

Input Format

[string containing delimiters: comma, semicolon, or colon]

Output Format

Output each split element on a separate line.

Example

Input:

apple,banana;cherry:date

Output:

apple
banana
cherry
date

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up