Rahul Pandit.

5 Mar 2022

How can I split a given String into a pattern consisting of uppercase and lowercase alphabets in Java?


Given a String S, I want to find a string containing one lowercase letter and one uppercase letter for the alphabet.

If S = "aAbBcdEec", I want to get "aAbB" and "Ee".

And if S = "abcABCadD", I want to get "abcABC" and "dD".

I've been thinking of StringBuilder or Pattern as a way to solve this, but to no avail.

I don't even need code to solve this, can you guys give me a hint?



5 Mar 2022


You are looking answer for java, not javascript

Also, share your code or show your efforts!

© 2023 Copyrights reserved for web-brackets.com