web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

store string in a variable

(4) ShareShare
ReportReport
Posted on by 1,979
Hi,

How to save this xml inside a string:
I'm getting errors because of the quotations
 
        str xml = "<?xml version="1.0" encoding="UTF-8"?>
            <note>
            <to>Tove</to>
            <from>Jani</from>
            <heading>Reminder</heading>
            <body>Don't do it!</body>
            </note>";

Categories:
I have the same question (0)
  • Suggested answer
    Waed Ayyad Profile Picture
    9,047 Super User 2025 Season 2 on at
    Hi @..,
     
    You should use Escape character before "
     as below
     
     str myText = "He said, \"Hello\" and left.";
     
    String value:  He said, "Hello" and left.
     

     

    Thanks,

    Waed Ayyad

    If this helped, please mark it as "Verified" for others facing the same issue

  • André Arnaud de Calavon Profile Picture
    301,482 Super User 2025 Season 2 on at
    Hi ..,
     
    Can you tell us what exactly you are doing in Dynamics 365 and what errors you get?
  • Suggested answer
    Martin Dráb Profile Picture
    238,149 Most Valuable Professional on at
    Because the string contains multiple double quotes and only a single one, a better approach will be wrapping the string in single quotes and escape only the single quote / apostrophe: '<?xml version="1.0" ... Don\'t ...'.
  • Waed Ayyad Profile Picture
    9,047 Super User 2025 Season 2 on at

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 763 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 413 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 284 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans