Stripping extra characters on a string

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1270
Joined: 23 Nov 2010
Has thanked: 720 times
Been thanked: 222 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: 2021
Joined: 21 Jul 2007
Has thanked: 174 times
Been thanked: 402 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

These users thanked the author bowlesj3 for the post (total 3):
arjfcaStan BokovJoshM

arjfca
Posts: 1270
Joined: 23 Nov 2010
Has thanked: 720 times
Been thanked: 222 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”