Make string_slice more generic