::EscapeEmbededQuotesIfLiteral

This command will insert a “\” character before every instance of a specified character in a specified string.

Syntax

::model::EscapeEmbededQuotesIfLiteral argString

Application

MotionView Tcl

Description

If the specified string does not start with a double-quote and end with a double-quote, this function just returns the specified string unmodified. However, if the specified string starts and ends with a double-quote character, then any double quote between those double-quotes has a “\” character inserted before them.

Inputs

argString
This argument is the string that is to have an escape character (“\”) inserted before any contained double-quote if this string’s first and last characters are double-quotes.

Example

::model::GetHandleFromFullVarname selhandle MODEL
set newLbl [::model::_private::EscapeEmbededQuotesIfLiteral "\"POINT_0\""]
selhandle InterpretEntity pthandle Point p_0 $newLbl

Errors

If the specified string starts and ends with double-quotes, a copy of that string is returned with any double-quotes contained within it have an escape character inserted before them. Otherwise, the specified string is returned unmodified.