Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    Athens,GR
    Posts
    16

    Question Unanswered: function conversion

    I wrote this function in vb but its veeery slow.i need to exclude the symbol included in the quotes from every string my loop finds.
    how this function converts to sql statements?

    Function MyTrim(str As String) As String
    Dim q As Integer
    Dim tmpstr As String

    For q = 1 To Len(str)
    If Mid(str, q, 1) <> " " Then
    tmpstr = tmpstr & Mid(str, q, 1)
    End If
    Next

    MyTrim = tmpstr

    End Function

    THANK YOU

  2. #2
    Join Date
    Feb 2002
    Posts
    13
    Test this code , not sure if it faster .

    Do While Instr(str,1," ") > 1
    Mid(str, Instr(str, 1, " "), 1) = ""
    Loop

    or in VB6

    CustName = Replace(CustName, " ", "")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •