public static String getANSIControlSequenceAt ( String string , int index ) { int len = getANSIControlSequenceLength ( string , index ) ; return len == 0 ? null : string . substring ( index , index + len ) ; }
Given a string and an index in that string returns the ANSI control sequence beginning on this index . If there is no control sequence starting there the method will return null . The returned value is the complete escape sequence including the ESC prefix .