013-004-007

Split String with Regex

Easy

Problem Description

Split String with Regex

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

Overview

Create a program that splits a string using a regex pattern and outputs each part.

Specifications

  • Initialize string data with "apple,banana;cherry:date"
  • Use regex pattern "[,;:]" (comma, semicolon, or colon)
  • Output each split element on a separate line

Output Format

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?