(Copied from locked
thread in intermediate forum, just to save anyone recreating what I've put below - Think Jesper is probably right)
Not sure where you're going wrong , but it works on my machine
Are you sure String st contains what you think it contains ?
I just tried it out using the following class, the file test.txt contains one line as follows
insert into raexceptionlog (ErrorMsg) values ('The valid combination is \'R\' & \'-\' OR \'D\') The result is
72
Pos found in file is 72
Note that if you're building the String up in the source code as in String st below you need the escape characters.
code: