trimmed substring to substr