GCX-ARC practice question 13 of 15

Select the correct format for a literal string expression for the following sentence: He said, “I will schedule the meeting for the specific time zone with AM/PM settings”.

Full set: 60 questions
Answer options
A: “He said, \' I will schedule the meeting for the specific time zone with AM \\ PM settings\’”
B: He said, I will schedule the meeting for the specific time zone with AM \\ PM settings\
C: “He said, /" I will schedule the meeting for the specific time zone with AM // PM settings/””
D: “He said, \" I will schedule the meeting for the specific time zone with AM \\ PM settings\”” Correct answer
Correct Answer:
D. “He said, \" I will schedule the meeting for the specific time zone with AM \\ PM settings\””
Explanation

In Genesys Architect, string literals must be enclosed in double quotes ("). Special characters within the string need to be escaped using a backslash (\). The sentence contains two special characters that require escaping: the inner double quotes (") and the literal backslash (\) intended between "AM" and "PM". The inner double quotes must be written as \", and the literal backslash must be written as \\. Option D correctly applies this syntax, enclosing the entire string in double quotes and properly escaping both the inner quotes and the backslash.

Why Incorrect

A. This option incorrectly attempts to escape a single quote (\'), which is unnecessary within a double-quoted string, and uses smart quotes (’) instead of standard ones.
B. This is not a valid string literal because it is not enclosed in double quotes.
C. This option incorrectly uses a forward slash (/) as an escape character instead of a backslash (\) and has an extra, unescaped double quote at the end.

References

1. Genesys Cloud CX Resource Center, "Literals in expressions." This document specifies the syntax for string literals. It states, "A string literal is a sequence of zero or more characters enclosed in double quotes ("")." It also provides a table of escape sequences, including \" for a double quote and \\ for a backslash. (Accessed under the Architect > Expressions section).

2. Genesys Cloud CX Resource Center, "Expressions overview." This page confirms that Architect's expression language syntax requires specific handling for literals. The principles outlined are consistent with standard programming languages where backslashes are used to escape special characters within a string defined by double quotes. (Accessed under the Architect > Expressions section).

Scroll to Top