Javatpoint Logo
Javatpoint Logo

Java Pattern splitAsStream(CharSequence input) Method

The splitAsStream method of Pattern class returns a stream of String whose elements match the pattern. This method matches the pattern against the input sequence and returns the stream. If this pattern does not match any subsequence of the input, then the resulting stream has just one element, namely the input sequence in string form.

Syntax:

Parameter:

The stream of strings computed by splitting the input around matches of this pattern

Since:

1.8

Example 1

Test it Now

Output:

java
php
asp

Example 2

Test it Now

Output:

Example 3

Test it Now

Output:

aa1bb3cc4dd4ee-[aa!bb!cc!dd!ee]
a5b5c5d5-[a!b!c!d]
Next TopicJava Regex





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA