Since you all like his code so well.
-
Here's another example of some great coding skills. I'm thinking he get's paid in CPU cycles used by application AND lines of code written.
'*********************************************************************
'* FindCharacters
'*
'* This subroutine finds and optionally replaces specific characters
'* with another chjaracter. It also returns the position(s) of
'* specific characters not in the string.
'*********************************************************************Public Sub FindCharacters(ByRef strData As String, _
ByVal strValidCharSet As String, _
ByVal strReplChar As String, _
ByRef strMsg As String)Dim strWork As String
Dim strCH As String
Dim intLoop As IntegerstrWork = ""
strMsg = ""For intLoop = 0 To strData.Length - 1
strCH = strData.Substring(intLoop, 1)If strValidCharSet.IndexOf(strCH) = -1 Then
strWork = String.Concat(strWork, strReplChar)
strMsg = String.Concat(strMsg, (intLoop + 1).ToString, ", ")
Else
strWork = String.Concat(strWork, strCH)
End If
NextIf strMsg <> "" Then
strMsg = strMsg.Substring(0, strMsg.Length - 2)
End IfstrData = strWork
End Sub
-
Here's another example of some great coding skills. I'm thinking he get's paid in CPU cycles used by application AND lines of code written.
'*********************************************************************
'* FindCharacters
'*
'* This subroutine finds and optionally replaces specific characters
'* with another chjaracter. It also returns the position(s) of
'* specific characters not in the string.
'*********************************************************************Public Sub FindCharacters(ByRef strData As String, _
ByVal strValidCharSet As String, _
ByVal strReplChar As String, _
ByRef strMsg As String)Dim strWork As String
Dim strCH As String
Dim intLoop As IntegerstrWork = ""
strMsg = ""For intLoop = 0 To strData.Length - 1
strCH = strData.Substring(intLoop, 1)If strValidCharSet.IndexOf(strCH) = -1 Then
strWork = String.Concat(strWork, strReplChar)
strMsg = String.Concat(strMsg, (intLoop + 1).ToString, ", ")
Else
strWork = String.Concat(strWork, strCH)
End If
NextIf strMsg <> "" Then
strMsg = strMsg.Substring(0, strMsg.Length - 2)
End IfstrData = strWork
End Sub
EyeYamFedUp wrote:
It also returns the position(s) of '* specific characters not in the string.
he must be genius
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
Here's another example of some great coding skills. I'm thinking he get's paid in CPU cycles used by application AND lines of code written.
'*********************************************************************
'* FindCharacters
'*
'* This subroutine finds and optionally replaces specific characters
'* with another chjaracter. It also returns the position(s) of
'* specific characters not in the string.
'*********************************************************************Public Sub FindCharacters(ByRef strData As String, _
ByVal strValidCharSet As String, _
ByVal strReplChar As String, _
ByRef strMsg As String)Dim strWork As String
Dim strCH As String
Dim intLoop As IntegerstrWork = ""
strMsg = ""For intLoop = 0 To strData.Length - 1
strCH = strData.Substring(intLoop, 1)If strValidCharSet.IndexOf(strCH) = -1 Then
strWork = String.Concat(strWork, strReplChar)
strMsg = String.Concat(strMsg, (intLoop + 1).ToString, ", ")
Else
strWork = String.Concat(strWork, strCH)
End If
NextIf strMsg <> "" Then
strMsg = strMsg.Substring(0, strMsg.Length - 2)
End IfstrData = strWork
End Sub
I think I need a lobotomy...
strCH = strData.Substring(intLoop, 1)
this is to extract the char of strData in each iteration, rigth? Argh! X|