This article explains how to use the Escape Character in LightSwitch Visual Studio 2012.To prevent characters from being interpreted as a format string specifier, precede it with the escape character, the "\" symbol. This "\" symbol signifies that the following character is a character literal that must be included in the unchanged output string.Note: To include a backlash in a string, you must escape with another backslash symbol, in other words "\\".Use of Escape CharacterThe Escape Character causes the next character to be interpreted as a literal rather than as a custom format specifier.Use the following procedure to create a sample showing how to use the Escape Character on a Screen.Step 1Open the LightSwitch Application in Visual Studio 2012 and go to the Solution Explorer.Right-click on "Data Sources" and choose "Add Table".The table appears in the Table Designer window. Insert the records in the following table.Step 2Now once again go to the Solution Explorer, right-click on "Screens" and choose "Add Screen".The Add New Screen dialog box appears. Select the "Editable Grid Screen" from the Screen Template. Inside the screen information, choose "Student" under screen data and provide a name to the Screen and click the "OK" button.The Screen Designer appears as shown below.Step 3Press F5 to run the application. Provide the information. Step 4Now stop debugging the application. From the Table Designer select the "Fees" record as shown in the figure below.Then go to the Format Pattern of Property window in the Table Designer and enter "\####\#" in the format pattern as shown.Once again press F5 to run the application. This time we will get the following output.Step 5 Now to add an additional backslash to the format pattern. Once again stop debugging the application and go to the Format Pattern of the Property window in the Table Designer. This time enter "\##\\##\#" in the format pattern of the Property window. Here 4 represents 4 digits that will be there after the decimal places. Once again press F5 to run the application. This time we will get the following output.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: