Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I need to find an index of string '* ??-??? *' where question mark is a single digit and a star is any number of characters. 2nd and 3rd digits are seperated by a dash and there are spaces before 1st anf after 5th digit.
Example
String: Berliner Str. 154 20-254 Chemnitz
Substring: 20-254
Result: 27
So far I used MapSubString replacing ??-??? with a special character and found the index but it happened that ??-??? appeared in another part of a string (e.g. String: Berliner Str. 146-148 20-254 Chemnitz; Substring: 46-148) and MapSubString won't work here as it can't cope with surrounding spaces (when mapping ' 46-148 ' MapSubString will actually map '46-148'). Any idea how to get that index?
Regards,
Przemek
Przemek, could you post your current script snippet?
You may replace each digit with 'n' and then locate 'nn-nnn' using index() function
I can't due to the problem described in the above example.
I found a workaround - when loading data from a file instead of inline QV recognises surrounding spaces so I moved all MapSubString data to a file.