Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This is a string cleaner....
Author:
Gilles Manouvrier
E-mail:
Click to e-mail author
Website:
http://gmanouvrier.free.fr
Submitted:
12/21/2000
Version:
VB3
Compatibility:
VB3, VB4, VB5, VB6
Category:
String Manipulation
Views:
9886
This is a string cleaner.
Declarations:
'none
Code:
Public Function OnlyChars(ByVal txt As String, ByVal Uchars As Boolean, ByVal Lchars As Boolean, ByVal Digits As Boolean, Optional Remplacement As String) As String Dim h As Long Dim tempon As String For h = 1 To Len(txt) num = Asc(Mid$(txt, h, 1)) 'suppression des uchars If Uchars Then If (num >= 65 And num <= 90) Or num = 32 Then tempon = tempon & Mid$(txt, h, 1) Else tempon = tempon & Remplacement End If End If If Lchars Then If (num >= 97 And num <= 122) Or num = 32 Or num = 224 Or num = 225 Or num = 232 Or num = 233 Or num = 234 Or num = 235 Or num = 249 Or num = 250 Or num = 251 Then tempon = tempon & Mid$(txt, h, 1) Else tempon = tempon & Remplacement End If End If If Digits Then If (num >= 48 And num <= 57) Or num = 32 Then tempon = tempon & Mid$(txt, h, 1) Else tempon = tempon & Remplacement End If End If 'If Uchars And Lchars And Digits Then tempon = tempon & Mid$(txt, h, 1) Next OnlyChars = tempon End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement