Re: Text Functions

From: MGFoster (me_at_privacy.com)
Date: 03/02/05


Date: Wed, 02 Mar 2005 20:47:00 GMT

Kirk P. wrote:
> Is there a function to remove spaces within a text field?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There isn't a built-in one. Try this:

Function NoSpaces(ByVal s As String) As String

   Const WHITESPACE = " "

   s = Trim$(s)

   Dim p As Long
   p = InStr(s, WHITESPACE)
   Do While p > 0
     s = Left$(s, p - 1) & Mid$(s, p + 1)
     p = InStr(p, s, WHITESPACE)
   Loop

   NoSpaces = s

End Function

-- 
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQiYmQYechKqOuFEgEQK2fwCgom0kccXof542/iDl4WUxG1inl/gAoNFz
zok80z7tPp2+Ero3V5l3Dr4r
=IxoP
-----END PGP SIGNATURE-----


Relevant Pages

  • Re: Need help with regular expression
    ... Hash: SHA1 ... Lars Enderin schreef: ... I'm using String.matches(regex) to find out if the string matches ...
    (comp.lang.java.help)
  • Re: sql syntax error
    ... Hash: SHA1 ... The red highlight is a VBA error indication, not a SQL syntax error. ... the string probably isn't properly formatted for VBA. ...
    (comp.databases.ms-access)
  • Re: Testing to see if a query is open
    ... Hash: SHA1 ... Function IsOpen(strName As String, _ ... ' Get the current state of the named object ...
    (microsoft.public.access.queries)
  • Re: hash of a string is the same string?
    ... For a randomly chosen n-bit hash, the probability that there is no ... I don't think there's any known reason to expect either MD5 or SHA1 to ...
    (sci.crypt)
  • Re: Trying to use Year as a variable
    ... > fiield. ... Hash: SHA1 ... You have to turn a string into a date. ...
    (microsoft.public.access.queries)