Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 ASP Articles

A function to remove the punctuation marks from a string.

Function removePunctuation(str)
     'Remove extraneous spaces
     Dim regEx, Match, Matches
     Set regEx = New RegExp
     regEx.Global = true
     regEx.IgnoreCase = True
     regEx.Pattern = "\s{2,}"
     str = Trim(regEx.Replace(str, " "))
     'Remove the space between the end of a word and a punctuation mark
     regEx.Pattern = "(\!|\.|\?|\;|\,|\:,|\&,|\_,|\{,|\},|\[,|\],|\(,|\),|\(,|\),|\~,|\#)"
     removePunctuation = regEx.Replace(str, "")
End Function

The function should be called as:

strValue = removePunctuation(strString)


This article viewed: 2390 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Tuesday, May 13, 2008