Any reason not to just do this as `fieldName = fieldName.replace(/[!?]/g, '');`? Also, do you really only want to remove the `?` and `!` from the end of field names as the comment says? If you only want to remove them from the end of the field names then you can use `fieldName = fieldName.replace(/[!?]$/g, '');`