Multiple spaces, using \" \" : Regular Expression « Development Class « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Development Class » Regular ExpressionScreenshots 
Multiple spaces, using \" \"
  

using System;
using System.Text.RegularExpressions;


public class MainClass {
    public static void Main() {
        string u = "Once   Upon A Time In   America";
        Regex p = new Regex(" ");
        foreach (string ss in p.Split(u)) {
            Console.WriteLine(ss);
        }
    }
}

   
  
Related examples in the same category
1.Multiple different delimiters
2.Single space split
3.Multiple spaces, using \"[\\s]+\"
4.Single spaces, using ()
5.Single spaces, using new Regex("( )")
6.Position and index
7.Regex and letter case
8.((an)|(in)|(on))
9.Gr(a|e)y
10.Define groups 'ing', 'in', 'n'
11.Leading space
12.Proper case match
13.Use | to combine different case
14.IP address
15.Use regular expression to replace charsUse regular expression to replace chars
16.Use regular to replace stringsUse regular to replace strings
17.Use regular to replace wordUse regular to replace word
18.Use regular expression to replace first 3 digitsUse regular expression to replace first 3 digits
19.Use regular to split stringUse regular to split string
20.Validate first name and last name
21.Validate address
22.Validate city name
23.Validate ZIP code
24.Validate Phone Number
25.Use regular to verify a dateUse regular to verify a date
26.HTML Parser
27.Define a regular expression for repeated wordsDefine a regular expression for repeated words
28.Gets the group name that corresponds to the specified group number.
29.Indicates whether the regular expression specified in the Regex constructor finds a match in the input string.
30.Regex.IsMatch Method
31.Regex.IsMatch Method (String, String, RegexOptions)
32.Match Class represents the results from a single regular expression match.
33.Get MatchCollection
34.Is match successful
35.Gets a collection of groups matched by the regular expression.
36.Get CaptureCollection
37.Returns a new Match object with the results for the next match, starting at the position at which the last match ended
38.Returns the expansion of the specified replacement pattern.
39.Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string.Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string.
40.Gets an individual member of the collection.
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.