Progress Monitor for IdealProgrammer.com
Take Swift, Intelligent, Massive, Planned, Loving, Effective (S.I.M.P.L.E.) Action to Transform Self into Ideal
Skip Repetitive Navigational Links
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console
Please login
C-Sharp Split Example Syntax - C# String Function - Sample Code
Description:
Illustrates the C# Syntax for Split.
Example Class Main:
using System; using System.Collections.Generic; public class clsSplit { public void Main() { //**************************************************************************************** // Example #1: Split(string[, delimiter][, limit]) // Parses a string into a one-dimensional array of one or more // substrings. If the delimiter is not specified, space is used. // If the limit is not specified, all substrings are returned //**************************************************************************************** Console.WriteLine("Example #1: Split(string[, delimiter][, limit])"); string strField = "This is my string"; string[] aryStrings = null; aryStrings = strField.Split(' '); for (var i = 0; i < aryStrings.Length; i++) { Console.WriteLine(aryStrings[i]); } //Console.WriteLine(Split(strField, strOldField, strNewField)) 'Returns This is your string //write blank line to make output easier to read Console.WriteLine(); //Prevent console from closing before you press enter Console.ReadLine(); } }
Example Class Program:
using System; using System.Collections.Generic; using System.Linq; using System.Text; nameSplit CSharp_Syntax { class Program { static void Main(string[] args) { clsSplit mySplit = new clsSplit(); mySplit.Main(); } } }
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console