public static String toFileName ( String name ) { char [ ] charArray = name . toCharArray ( ) ; StringBuilder builder = new StringBuilder ( ) ; for ( int i = 0 ; i < charArray . length ; i ++ ) { if ( Character . isUpperCase ( charArray [ i ] ) && i > 0 && ! Character . isUpperCase ( charArray [ i - 1 ] ) ) { builder . append ( ' ' ) ; } builder . append ( Character . toLowerCase ( charArray [ i ] ) ) ; } return builder . toString ( ) ; }
transforms helloWorld to hello . world to more closely resemble typical typescript naming .