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
Extension of Trim Function provided By VB. It can ...
Author:
Manish Gandhi
E-mail:
Click to e-mail author
Submitted:
1/23/2003
Version:
VB3
Compatibility:
VB3, VB4, VB5, VB6
Category:
String Manipulation
Views:
11167
Extension of Trim Function provided By VB. It can strip off any leading, trailing, any number of specified characters.
Declarations:
'none
Code:
Private Function ExtendedTrim(strLine As String, strCharacter As String) As String Dim strTemp As String Dim I As Integer ' Stripping Leading Characters For I = 1 To Len(strLine) Step Len(strCharacter) If Mid(strLine, 1, Len(strCharacter)) = strCharacter Then strLine = Mid(strLine, Len(strCharacter) + 1) Else Exit For End If Next I% ' Stripping Trailing Characters For I = Len(strLine) To 1 Step -Len(strCharacter) If Mid(strLine, Len(strLine) - Len(strCharacter) + 1) = strCharacter Then strLine = Mid(strLine, 1, Len(strLine) - Len(strCharacter)) Else Exit For End If Next I% ExtendedTrim = strLine End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement