Skip to main content

String operations in c sharp # using Microsoft visual studio 2010

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

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            string s,find;
            int l,i=0;
            s = Console.ReadLine();
            string.Concat(s);
            l=s.Length;
            Console.WriteLine(s);
            Console.WriteLine("length\t"+l );
           
            Console.WriteLine("first and last character  " + s[0]+"  "+s[l-1] );
            for (i = 0; i < l; i++)
            {
                Console.WriteLine(s.Substring(0,i+1));
            }
            Console.WriteLine("Enter string to find:");
            find = Console.ReadLine();
            Console.WriteLine("search is \t" + s.Contains(find));
            Console.WriteLine("INDEX OF \t" + s.IndexOf(find));
            Console.WriteLine(string.Concat(s, find));
            Console.Read();

        }
    }
}


Comments

Popular posts from this blog

unix commands