Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jenya Mia
Added: Mar 19, 2019 12:46 PM
Views: 5
Tags: split string
  1. static String splitCamelCase(String s)
  2. {
  3.    return s.replaceAll(
  4.       String.format("%s|%s|%s",
  5.          "(?<=[A-Z])(?=[A-Z][a-z])",
  6.          "(?<=[^A-Z])(?=[A-Z])",
  7.          "(?<=[A-Za-z])(?=[^A-Za-z])"),
  8.       " "
  9.    );
  10. }