Skale
asked on
How to keep double-quote(") if string value contains it in vb.net
Hello,
I'm getting some values from excel and some cells have values like "eedm05__6924_.pdf" and this values later assigned to another program in here if all cells has same type value i can easily add double quote to start and end of the cell value but some of them integer some of them different type.
So first it should check has it contains " after that should keep them.
Any help would be grateful.
Thanks.
I'm getting some values from excel and some cells have values like "eedm05__6924_.pdf" and this values later assigned to another program in here if all cells has same type value i can easily add double quote to start and end of the cell value but some of them integer some of them different type.
So first it should check has it contains " after that should keep them.
Any help would be grateful.
Thanks.
ASKER
I think my problem is different i thought because of that but my problem is COM program cannot recognize my strings and i checked documentation and found convert type of string like below;
E.g.
My string is like below;
Dim strComment As String = """ra1__Pulse-VF46-160__GH 0072_112__ 180720.cgi """
Output string should be like
"\"ra1__Pulse-VF46-160__GH 0072_112__ 180720.cgi \""
E.g.
My string is like below;
Dim strComment As String = """ra1__Pulse-VF46-160__GH
Output string should be like
"\"ra1__Pulse-VF46-160__GH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'll just tackle a few things, and hope it's enough to get you going.
"but some of them integer some of them different type."
That's very difficult to handle. I assume you want it all to finally all be in the String format, I hope?
Open in new window
Yes, there are 4 quotes in each group you see. As two are enclosing quotes for it to be a string. The other two inside the enclosing two are there, because you need to escape one quote for it to be a real quote inside the string.
"So first it should check has it contains " after that should keep them."
If you have read the cell string, and it was "eedm05__6924_.pdf", in memory it would be the same as
Open in new window
As you can see, another set of 4 quotes, to check if a string contains one double quote.
If this doesn't help you at all, please provide some code you already have and explain some more about what you're trying to achieve.