added \!substr and inverse substr from James