<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic String format help in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/string-format-help/m-p/445807#M34944</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String = "BLVF"&lt;/P&gt;&lt;P&gt;I want to format string&amp;nbsp; to&amp;nbsp; \"BLVF\". &lt;/P&gt;&lt;P&gt;I tried it like "\'{}\'".format(String)&lt;/P&gt;&lt;P&gt;It gives me wrong answer. pl give me a help to format this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Padmasiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Nov 2014 06:40:00 GMT</pubDate>
    <dc:creator>H_A_D_Padmasiri</dc:creator>
    <dc:date>2014-11-19T06:40:00Z</dc:date>
    <item>
      <title>String format help</title>
      <link>https://community.esri.com/t5/python-questions/string-format-help/m-p/445807#M34944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String = "BLVF"&lt;/P&gt;&lt;P&gt;I want to format string&amp;nbsp; to&amp;nbsp; \"BLVF\". &lt;/P&gt;&lt;P&gt;I tried it like "\'{}\'".format(String)&lt;/P&gt;&lt;P&gt;It gives me wrong answer. pl give me a help to format this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Padmasiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 06:40:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/string-format-help/m-p/445807#M34944</guid>
      <dc:creator>H_A_D_Padmasiri</dc:creator>
      <dc:date>2014-11-19T06:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: String format help</title>
      <link>https://community.esri.com/t5/python-questions/string-format-help/m-p/445808#M34945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said this didn't work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14163808962752158 jive_text_macro" jivemacro_uid="_14163808962752158"&gt;
&lt;P&gt;"\'{}\'".format(String)&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14163808732258851 jive_text_macro" jivemacro_uid="_14163808732258851"&gt;
&lt;P&gt;'"{}"'.format(string)&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I good way to test this kind of thing is at the Python command line. This prints the string representation of the result, in this example, the output is: double quote, t, e, s, t, double quote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14163808669749563 jive_text_macro" jivemacro_uid="_14163808669749563" modifiedtitle="true"&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; '"{}"'.format("test")&lt;/P&gt;
&lt;P&gt;'"test"'&lt;/P&gt;
&lt;P style="font-size: 11px; font-family: Menlo;"&gt;&amp;gt;&amp;gt;&amp;gt; '"\\test\\"'&lt;/P&gt;
&lt;P style="font-size: 11px; font-family: Menlo;"&gt;'"\\test\\"'&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 07:08:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/string-format-help/m-p/445808#M34945</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-11-19T07:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: String format help</title>
      <link>https://community.esri.com/t5/python-questions/string-format-help/m-p/445809#M34946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've moved your post into the &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt; space. You will get a much better answer here as the &lt;A _jive_internal="true" href="https://community.esri.com/community/help-and-feedback"&gt;GeoNet Help&lt;/A&gt; is intended for community help and feedback. You can see more on the community structure, and what topics are under each space from the following documents:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1544"&gt;GeoNet Community Structure&lt;/A&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1545"&gt;ArcGIS Discussion Forums Migration Strategy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Thanks!&lt;/P&gt;&lt;P style="font-family: Calibri; font-size: 11.0pt;"&gt;Timothy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 13:37:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/string-format-help/m-p/445809#M34946</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2014-11-19T13:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: String format help</title>
      <link>https://community.esri.com/t5/python-questions/string-format-help/m-p/445810#M34947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Padmasiri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;string = "BLVF"&lt;/P&gt;&lt;P&gt;print '"\\' + string + '\\"'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 15:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/string-format-help/m-p/445810#M34947</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-11-19T15:56:16Z</dc:date>
    </item>
  </channel>
</rss>

