Click here to Skip to main content
15,896,606 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: SMS Application Pin
Coding C#18-Aug-06 1:56
Coding C#18-Aug-06 1:56 
GeneralRe: SMS Application Pin
FeRtoll18-Aug-06 13:44
FeRtoll18-Aug-06 13:44 
Question[Message Deleted] Pin
PREMSONBABY17-Aug-06 20:26
PREMSONBABY17-Aug-06 20:26 
AnswerRe: windows service Pin
Dave Sexton18-Aug-06 0:10
Dave Sexton18-Aug-06 0:10 
QuestionStrip out invalid characters from xml files [modified] Pin
Icharus17-Aug-06 17:10
Icharus17-Aug-06 17:10 
AnswerRe: Strip out invalid characters from xml files Pin
Christian Graus17-Aug-06 19:30
protectorChristian Graus17-Aug-06 19:30 
AnswerRe: Strip out invalid characters from xml files Pin
Guffa17-Aug-06 22:19
Guffa17-Aug-06 22:19 
AnswerRe: Strip out invalid characters from xml files Pin
Icharus18-Aug-06 8:05
Icharus18-Aug-06 8:05 
Thanks to Christian and Guffa.
Below is the solution I was able to come up with...

Public Structure HexReplacement
   Public HexCharacter As Char
   Public Replacement As String
End Structure

Public Shared Function ConvertHexToChar(ByVal hexValue As String) As Char
   Dim convertedChar As Char = Nothing
   Try
       convertedChar = Chr(Int32.Parse(hexValue, Globalization.NumberStyles.HexNumber))
   Catch ex As FormatException
       ' Error handling here....
   Catch ex As ArgumentException
       ' Error handling here....
   End Try
   Return convertedChar
End Function

Public Function CleanOutHexValues(ByVal dirtyString As String, ByVal hexReplacements As HexReplacement()) As String
   Dim cleanString As String = dirtyString
   For Each hr As HexReplacement In hexReplacements
       cleanString = cleanString.Replace(hr.HexCharacter, hr.Replacement)
   Next
   Return cleanString
End Function

Public Sub TestHexCharCleanUp()
   Dim hr(1) As HexReplacement
   hr(0).HexCharacter = ConvertHexToChar("0b") ' "0b" =  or single space.
   hr(0).Replacement = ""
   Dim dirtyString As String = "Testing the removal of  "
   MsgBox(CleanOutHexValues(dirtyString, hr))
End Sub


Comments will be greatly appreciated. Smile | :)
QuestionProgress Bar & ForeColor Pin
John Waclawski17-Aug-06 16:42
John Waclawski17-Aug-06 16:42 
AnswerRe: Progress Bar & ForeColor Pin
NGENEAR1118-Aug-06 16:32
NGENEAR1118-Aug-06 16:32 
AnswerRe: Progress Bar & ForeColor Pin
John Waclawski19-Aug-06 20:05
John Waclawski19-Aug-06 20:05 
QuestionProblem passing field from parent, to child form Pin
penguin500017-Aug-06 16:26
penguin500017-Aug-06 16:26 
AnswerRe: Problem passing field from parent, to child form Pin
Robotovich18-Aug-06 9:24
Robotovich18-Aug-06 9:24 
AnswerRe: Problem passing field from parent, to child form Pin
Scott Serl18-Aug-06 9:54
Scott Serl18-Aug-06 9:54 
QuestionGoogle search trouhh my app Pin
FeRtoll17-Aug-06 13:25
FeRtoll17-Aug-06 13:25 
AnswerRe: Google search trouhh my app Pin
Christian Graus17-Aug-06 14:08
protectorChristian Graus17-Aug-06 14:08 
GeneralRe: Google search trouhh my app Pin
FeRtoll17-Aug-06 14:23
FeRtoll17-Aug-06 14:23 
GeneralRe: Google search trouhh my app Pin
_mubashir17-Aug-06 21:10
_mubashir17-Aug-06 21:10 
GeneralRe: Google search trouhh my app Pin
FeRtoll18-Aug-06 13:41
FeRtoll18-Aug-06 13:41 
AnswerRe: Google search trouhh my app Pin
Coding C#18-Aug-06 2:05
Coding C#18-Aug-06 2:05 
GeneralRe: Google search trouhh my app Pin
FeRtoll18-Aug-06 13:40
FeRtoll18-Aug-06 13:40 
QuestionUsing the progress bar control to track database activities Pin
Robotovich17-Aug-06 6:42
Robotovich17-Aug-06 6:42 
AnswerRe: Using the progress bar control to track database activities Pin
Stephen McGuire17-Aug-06 8:50
Stephen McGuire17-Aug-06 8:50 
GeneralRe: Using the progress bar control to track database activities Pin
Robotovich18-Aug-06 9:19
Robotovich18-Aug-06 9:19 
GeneralRe: Using the progress bar control to track database activities [modified] Pin
Stephen McGuire18-Aug-06 9:42
Stephen McGuire18-Aug-06 9:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.