Stripping extra characters on a string

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Stripping extra characters on a string

Postby arjfca » 12 Jul 2011

Hello

I'm reading a string from Excel. I suspect that the string came in with Extra characters.
What could be the proper manner to strip any non printable characters?

Martin

bowlesj3
Posts: 2180
Joined: 21 Jul 2007
Has thanked: 227 times
Been thanked: 429 times

Re: Stripping extra characters on a string

Postby bowlesj3 » 12 Jul 2011

Maybe there is a way to modify this VBA code for EL. I have never tried it.

Code: Select all

strTempLongShort = GV_GetNamedString("Hld_" & strMySym & "_Side", "Not Sure")
call funcShowAscii( strTempLongShort)



Public Function funcShowAscii(strX As String)
Dim strASC As String
Dim i As Long
For i = 1 To Len(strX)
strASC = strASC & CStr(Asc(Mid(strX, i, 1))) & "-"
Next
MsgBox "ASC=" & strASC
End Function

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Stripping extra characters on a string

Postby arjfca » 12 Jul 2011

Hello Johns

In fact I just resolved the problem by formatting the Excel cell as text. I should had taught it before ;)

I will keep your formula for a future usage

Martin


Return to “MultiCharts”