Example of duplicated and merged string: 16.01068.0%0 8p%.a .p .a. Desired substring to be extracted: 16.008% p.a. Fuller example: CCoonnttiinnggeenntt CCoouuppoonn 16.01068.0%0 8p%.a .p (.Ma.o (nMtholyn)thly) Desired substring: Contingent Coupon 16.008% p.a. (Monthly) My problem is when the original substring already has duplicate characters (like the two 0s in 16.008), my current function sometimes retains the wrong duplicate character (giving the incorrect result 16.080). Continue reading...