Please help convert this code to VB.NET code...
-
Hi, I beleive this sample code is in C#:
string cleanString = String.Empty; Regex reg = new Regex("[A-Z]|[a-z]"); MatchCollection coll = reg.Matches(); for(int i = 0; i < coll.Count; i++) { cleanString = cleanString + coll[i].Value; }
See, i want to remove all characters that do not fall in the A-Z or a-z OR 0-9 category AND replace it with a space... example test123t3er = test t er Am i wrong in saying that theRegex reg = Regex("[A-Z]|[a-z]")
CAN IT BE:Regex reg = Regex("[A-Z]|[a-z]|[0-9]")
??? AND thecleanString = cleanString + coll[i].Value;
CAN I DO A TEST:IF(coll[i].Value == String.Empty)
THENcleanString = cleanString + " "
ELSEcleanString = cleanString + coll[i].Value
???? - in this way i add space if the character is not in the above category???? So please help me convert the very top section of code and i will build from there... Thank you in advance..."Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
-
Hi, I beleive this sample code is in C#:
string cleanString = String.Empty; Regex reg = new Regex("[A-Z]|[a-z]"); MatchCollection coll = reg.Matches(); for(int i = 0; i < coll.Count; i++) { cleanString = cleanString + coll[i].Value; }
See, i want to remove all characters that do not fall in the A-Z or a-z OR 0-9 category AND replace it with a space... example test123t3er = test t er Am i wrong in saying that theRegex reg = Regex("[A-Z]|[a-z]")
CAN IT BE:Regex reg = Regex("[A-Z]|[a-z]|[0-9]")
??? AND thecleanString = cleanString + coll[i].Value;
CAN I DO A TEST:IF(coll[i].Value == String.Empty)
THENcleanString = cleanString + " "
ELSEcleanString = cleanString + coll[i].Value
???? - in this way i add space if the character is not in the above category???? So please help me convert the very top section of code and i will build from there... Thank you in advance..."Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
(via Instant VB): Dim cleanString As String = String.Empty Dim reg As New Regex("[A-Z]|[a-z]") Dim coll As MatchCollection = reg.Matches() For i As Integer = 0 To coll.Count - 1 cleanString = cleanString & coll(i).Value Next i David Anton http://www.tangiblesoftwaresolutions.com C++ to C# Converter C++ to VB Converter C++ to Java Converter Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: convert VB, C#, or Java to C++/CLI Java to VB & C# Converter: convert Java to VB or C#