Monsieur Winner

MS D365FO || Monsieur D365FO

Technical

How to escape backslash (\) in X++

 

There are times when you would want to write a backslash (\) in a string in X++. For instance, I would want to get the path of a file on Path:

C:\Users\UserName\Documents\Tasks

The backslash (“\”) character is a special escape character used to indicate other special characters such as new lines (\n), tabs (\t), or quotation marks (\”), therefore If you want to include a backslash character itself, you need two backslashes.

 

str itemFilePath = strFmt(“C:\\Users\\UserName\\Documents\Tasks”);

 

Merci

admin

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

0 thoughts on “How to escape backslash (\) in X++

Leave a Reply

Your email address will not be published. Required fields are marked *