@Nullable public static String extractClassName(@NotNull String string){
  StringBuilder sb=new StringBuilder(string.length());
  int n=string.length();
  int i=0;
  for (; i < n; i++) {
    char c=Character.toUpperCase(string.charAt(i));
    if (Character.isJavaIdentifierStart(c)) {
      sb.append(c);
      i++;
      break;
    }
  }
  if (sb.length() > 0) {
    for (; i < n; i++) {
      char c=string.charAt(i);
      if (Character.isJavaIdentifierPart(c)) {
        sb.append(c);
      }
    }
    return sb.toString();
  }
  return null;
}

@ Nullable public static String extractClassName ( @ NotNull String string ) { StringBuilder sb = new StringBuilder ( string . length ( ) ) ; int n = string . length ( ) ; int i = 0 ; for ( ; i < n ; i ++ ) { char c = Character . toUpperCase ( string . charAt ( i ) ) ; if ( Character . isJavaIdentifierStart ( c ) ) { sb . append ( c ) ; i ++ ; break ; } } if ( sb . length ( ) > 0 ) { for ( ; i < n ; i ++ ) { char c = string . charAt ( i ) ; if ( Character . isJavaIdentifierPart ( c ) ) { sb . append ( c ) ; } } return sb . toString ( ) ; } return null ; }
creates a java class name out of the given string , if possible . for example , " my project " becomes " myproject " , " hello " becomes " hello " , " java ' s " becomes " java " , and so on .
