private int countCharsStart ( final char ch , final boolean allowSpaces ) { int count = 0 ; for ( int i = 0 ; i < this . value . length ( ) ; i ++ ) { final char c = this . value . charAt ( i ) ; if ( c == ' ' && allowSpaces ) { continue ; } if ( c == ch ) { count ++ ; } else { break ; } } return count ; }
Counts the amount of ch at the start of this line optionally ignoring spaces .