// Edit this list with what you don't want NOT_ALLOWED_LIST = list(", Inc.", ", LLC", ", Inc", ", LLC.") NOT_ALLOWED_LIST_NAME = "NOT_ALLOWED_LIST" customer = getRecordHead("u_{2267/1912}") // Begin searching for not-allowed strings for not_allowed_index = 1 to NOT_ALLOWED_LIST.size repeat // Get the first not-allowed string to check this_not_allowed_str = getParameterNamed(NOT_ALLOWED_LIST_NAME, not_allowed_index) this_not_allowed_len = len(this_not_allowed_str) // Attempt to find the not-allowed string // - if found, will be non-zero // - if not found, will be zero attempt = inStr(customer, this_not_allowed_str) // If the not allowed string was found, // - from: the start of the original string (1) // - to: the attempt index (minus 1 to not include the 1st character) // - PLUS // - from: attempt index + the length of the search string // - to: the end of what remains if attempt <> 0 then customer = subStr(customer, 1, attempt - 1) + mid(customer, attempt + this_not_allowed_len) endif until attempt == 0 // repeat for all not-allowed strings next not_allowed_index // Output setRecordHead("u_{1903}", customer)