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
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\\"'
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:
ArcGIS Discussion Forums Migration Strategy
Thanks!
Timothy
Padmasiri,
Try this:
string = "BLVF"
print '"\\' + string + '\\"'