How to check for double quote in a string?
807580Nov 30 2009 — edited Dec 1 2009Hi All,
I am working on a bug and while analyzing it found that if the String does not have double quotes,then the logic fails.So can someone please tell me is there an efficient way of checking to see if the String contains double quotes at the beginning and at the end? If the double quotes does not exist,I should be able to append it.I would like to know if it is possible to do this without putting the string in a loop.
Here is the algorithm:
String fieldName = abc;
if(check if fieldName contains doublequotes)
do nothing
else
add double quote (String should look like this : "abc")
Edited by: ShubhaPradeep on Nov 30, 2009 4:42 PM