Dear sir
String = "BLVF"
I want to format string to \"BLVF\".
I tried it like "\'{}\'".format(String)
It gives me wrong answer. pl give me a help to format this
Thanks
Padmasiri
Padmasiri,
Try this:
string = "BLVF"
print '"\\' + string + '\\"'
I've moved your post into the Python space. You will get a much better answer here as the GeoNet Help 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:
GeoNet Community Structure
ArcGIS Discussion Forums Migration Strategy
Thanks!
Timothy
You said this didn't work:
"\'{}\'".format(String)
I suggest this:
'"{}"'.format(string)
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:
>>> '"{}"'.format("test") '"test"' >>> '"\\test\\"' '"\\test\\"'
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.