PR000041 practice question 2 of 15

What function could be used to exchange 'i' with 'I' in the COMPANY port given the following expression? function name{1, COMPANY, 'i' , 'I')

Choose your answer, then check it against the explanation and the full breakdown below.

What function could be used to exchange 'i' with 'I' in the COMPANY port given the following expression? function name{1, COMPANY, 'i' , 'I')
Answer options
Question 2 of 15

Question breakdown

Tests
Transformation language string functions
Difficulty
Easy

Key idea: REPLACECHR(CaseFlag, InputString, OldCharSet, NewChar) swaps each character found in a character set for one replacement character, and its four-argument shape matches the expression.

How to reach the answer

  1. Map the argument pattern: an integer flag, a port, an old character, and a new character.
  2. Recall which function begins with a case flag followed by a string and two character arguments. That is REPLACECHR.
  3. Confirm the goal is replacement, which rules out search functions like INSTR.
  4. REG_REPLACE takes subject, pattern, and replacement with no leading case flag, so its signature does not fit.
  5. CHOOSE only selects a value by index and never alters a string.

Each option

  • AIncorrect. CHOOSE returns one value from a list based on an index position; it does not modify characters inside a string.
  • BCorrect. REPLACECHR uses exactly this signature: a non-zero CaseFlag makes the match case-sensitive, and each 'i' in COMPANY becomes 'I'.
  • CIncorrect. REG_REPLACE is regex-based, takes subject, pattern, and replacement with an optional count, and has no leading case flag.
  • DIncorrect. INSTR returns the position of a substring and performs no replacement.

Common trap: REG_REPLACE sounds like the obvious 'replace' function, but its argument order does not match an expression that starts with a case flag.

In practice: REPLACECHR is commonly used in Expression transformations to clean or normalize characters, such as stripping punctuation or fixing casing in name and code fields.

Remember: An integer case flag as the first argument followed by a string points to REPLACECHR or REPLACESTR; a non-zero flag means case-sensitive.

Drafted with AI assistance and checked against the answer key.

Keep practicing

Take the free PR000041 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other PR000041 practice questions

Scroll to Top