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 Join Example Syntax - C# Join - Sample Code
Description:
Illustrates the C# Syntax for Join.
Example Class Main:
using System; public class clsJoin { public void Main() { //**************************************************************************************** // Example #1: Join(SourceArray(), Delimiter) // Returns a string created by joining a number of substrings contained in an array. // SourceArray - One-dimensional array containing substrings to be joined. // Delimiter - Optional. Any string, used to separate the substrings in the returned string. // If omitted, the space character (" ") is used. // If Delimiter is a zero-length string ("") or Nothing, all items in the list are concatenated // with no delimiters. // Return Value - Returns a string created by joining a number of substrings contained in an array. //**************************************************************************************** Console.WriteLine("Example #1: Join(String(), String) "); string[] arrayJoinExample = { "Apples", "Oranges", "Strawberries" }; // Return Uppercase Console.WriteLine(string.Join("!", arrayJoinExample)); //Returns Apples!Oranges!Strawberries //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; namespace CSharp_Syntax { class Program { static void Main(string[] args) { clsJoin myJoin = new clsJoin(); myJoin.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