Showing posts with label substring from a string. Show all posts
Showing posts with label substring from a string. Show all posts

Friday, 6 March 2015

Extract Substring From a String

Structure of the Problem Requirements 

This Program extract substring from a string in C# program. The program extract semicolon which occurred in string many times and in new string put all the alphabet of previous string except semicolon.  

Source Code 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LEPPOST
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(" \t \t \t Programming Hub\n\n");
String expression = "The; Hands; That; Rock; the Cradl;e Rules; The World;";
String[] strExpression = expression.Split(';');
foreach (String st in strExpression)
{
Console.Write(st);
}
Console.ReadKey();
}
}
}

Output of the Program

How to extract Substring From a String