Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Since you all like his code so well.

Since you all like his code so well.

Scheduled Pinned Locked Moved The Weird and The Wonderful
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EyeYamFedUp
    wrote on last edited by
    #1

    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 Integer

    strWork = ""
    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
    Next

    If strMsg <> "" Then
    strMsg = strMsg.Substring(0, strMsg.Length - 2)
    End If

    strData = strWork

    End Sub

    Y F 2 Replies Last reply
    0
    • E EyeYamFedUp

      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 Integer

      strWork = ""
      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
      Next

      If strMsg <> "" Then
      strMsg = strMsg.Substring(0, strMsg.Length - 2)
      End If

      strData = strWork

      End Sub

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      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[^]

      1 Reply Last reply
      0
      • E EyeYamFedUp

        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 Integer

        strWork = ""
        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
        Next

        If strMsg <> "" Then
        strMsg = strMsg.Substring(0, strMsg.Length - 2)
        End If

        strData = strWork

        End Sub

        F Offline
        F Offline
        fabrice leal
        wrote on last edited by
        #3

        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|

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups