Posts

Showing posts from September 1, 2014

Creating yourn own string methods and properties in c sharp # without using any predefined or system properties and functions

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

using Mynamespace;
namespace Test_question
{
    class Program
    {
        static void Main(string[] args)
        {
            string s, s2;
            int i;

            Console.WriteLine("ENter a string");
            s = Console.ReadLine();
            str ob = new str(s);

            Console.WriteLine("Length of the string " + ob.len);

            Console.WriteLine("Enter a position to extract character");
            i = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("the character is " + ob.charAt(i));

            Console.WriteLine("Enter string to concatenate");
            s2 = Console.ReadLine();
            Console.WriteLine(ob.concatenate(s, s2));
            str ob2 = new str(s2);



            Console.WriteLine("position is " + ob.indexof('a'));
            Console.WriteLine("position is &quo…