use the Split() method to split strings : String Split « Data Types « 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.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Data Types » String SplitScreenshots 
use the Split() method to split strings
   
using System;

class MainClass {

    public static void Main() {
        string[] myStrings = {"To""be""or""not","to""be"};
        string myString9 = String.Join(".", myStrings);
        myStrings = myString9.Split('.');
        foreach (string mySplitString in myStrings) {
            Console.WriteLine("mySplitString = " + mySplitString);
        }
    
    }
}

   
    
  
Related examples in the same category
1.Split with space
2.Split with a list of dividers
3.Split spaces with space
4.Show string in proper case
5.Splitting StringsSplitting Strings
6.Split and join stringsSplit and join strings
7.Tokenize stringsTokenize strings
8.Char String foreachChar String foreach
9.Split a string delimited by another string and return 2 non-empty elements
10.Split a string delimited by another string and return 2 elements
11.Split the original string at the delimiter and return all non-empty elements
12.Split a string delimited by another string and return all elements
13.Split a string delimited by characters and return all elements
14.Split a string delimited by characters and return 2 non-empty elements
15.Split a string delimited by characters and return 2 elements
16.Split a string delimited by characters and return all non-empty elements
17.Use StringSplitOptions enumeration to include or exclude substrings generated by the Split method.
18.Implements a StringTokenizer class for splitting a string into substrings using a set of delimiters.
19.String Tokenizer
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.