[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 311
  • Last Modified:

How to identify non-displaying characters in a text string?

Hello - trying to import some crap data, and I'm getting text values that have trailing non-display characters that Trim() won't... Trim...

is there a function that does the reverse of Chr(), so I can parse through and see what exactly these trailing characters are?

Thanks
0
mlagrange
Asked:
mlagrange
1 Solution
 
Dale FyeCommented:
ASC()
0
 
Rey Obrero (Capricorn1)Commented:
try this function

Function AlphaNumOnly(strIn As String) As String

Dim j As Integer
Dim varStr As String
varStr = strIn
While j < Len(varStr)
   j = j + 1
   Select Case Asc(Mid(varStr, j, 1))
            Case 32 To 126
            ' do nothing
   Case Else
      ' get rid of everything else:
      varStr = Left(varStr, j - 1)  &  Mid(varStr, j + 1)
      If j > 1 Then j = j - 1
   End Select
Wend
AlphaNumOnly = varStr
End Function
0
 
mlagrangeAuthor Commented:
Thanks again, Cap
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now