4 Replies Latest reply: Jun 21, 2014 3:41 AM by Przemysław Wojda RSS

    Index of string '* ??-??? *'

    Przemysław Wojda

      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