Dino
Dino

Reputation: 89

Preapre string with special characters

I am taking columns names from excel sheet and one of the column names which I am getting is as follows:

Recorded by" & vbLf & "FO Staff

For all excel columns names I have a list in my program to reflect all in excel to check if they match or not. However only that column giving me mentioned string. The problem is I don't know how to prepare my string to have same as text for comparison. Simply saying how to prepare string to get exactly the string I shown above? If possible with explanation.

EDIT: Didn't mentioned about one thing. I store all reflected values in xml config file. I serialize columns names (the same column values as in excel). My program deserialize xml file and load array of that items. Then that array is compared to the array of excel columns which are comming directly from excel.

Upvotes: 0

Views: 58

Answers (1)

A Friend
A Friend

Reputation: 2750

To get the exact string in your question, you need to double up the double quotes:

Dim colText = "Recorded by"" & vbLf & ""FO Staff"

EDIT:

It's not elegant, but to remove double quotes from the deserialised string:

colText.Replace("""""", """")

Upvotes: 1

Related Questions