In the code below, there is a populated array of type string. Because there are some " marks that I am not sure really exist or not, I want to remove them by converting the array into a string. However, it appears that the only option is ToText.
Two questions:
Whats the diff between string and text?
Is there a way to do this without having to dimension a new variable?
Thank you,
Tim
Dim tmpToNo() As String
Dim tToNo As String
tToNo = tmpToNo(1) // This gives the TO Number
Dim Num As integer = tToNo.ToInteger
tToNo = num.ToString
There’s no quickie answer to this - you’re just going to have to loop through the elements of the array and use ReplaceAll to remove the offending characters.
Four quotes = a double quote character. Two quotes = empty string. " “” " is Xojo’s way to express a double quote character with a space before and a space after.
Var startString() As String
startString.Add("""1""")
startString.Add("2")
startString.Add("3""")
For i As Integer = startString.FirstIndex To startString.LastIndex
startString(i) = startString(i).ReplaceAll("""","")
Next
2 quotes are for the string, let’s call them left and right quote or string endings, so if you only use 2 then is empty. To add a quote to a string we need a way to make it different, so a single quote within the string limits (left/right quote) needs to be doubled, so basically """" means:
first quote the start of the string code
last quote the end of the string code
second/third quote, add a single quote to the string