[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

string remove characters without having a line of code to remove each type

Posted on 2012-09-18
2
Medium Priority
?
312 Views
Last Modified: 2012-09-18
Is there a way to remove characters such as:  - / \ ( ) , ;
without having to write a line of code like the one below for each type of character?

strString = strString.replace("/","")

Open in new window

0
Comment
Question by:McGurk1
  • 2
2 Comments
 

Accepted Solution

by:
McGurk1 earned 0 total points
ID: 38411552
Got it at this link:  http://www.code-tips.com/2009/04/vbscript-string-clean-function-remove.html



strString = Regex.Replace(strString, "[-(?*"",\\<>&#~%{}+_.@:\/ !;]+", "")

Open in new window

0
 

Author Closing Comment

by:McGurk1
ID: 38411555
no points - found it at another site.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question