public static String getLineNumberFromExceptionTraceLine ( String exceptionTraceLine , String substrToSearch ) { String lineNumber = "" ; int index = exceptionTraceLine . indexOf ( substrToSearch ) ; if ( index >= 0 ) { int length = substrToSearch . length ( ) + index ; if ( exceptionTraceLine . lastIndexOf ( ' ' ) > length ) { lineNumber = exceptionTraceLine . substring ( length , exceptionTraceLine . lastIndexOf ( ' ' ) ) ; } } return lineNumber ; }
Get the error line number from the exception stack trace