Sunday, May 24, 2009

Exercise

/* Custom Project and Libraries Copyright, 2006. Venkat, ISS */

using System;
using System.Collections.Generic;
using System.Text;
using ISS.RV.LIB;

namespace Prog00
{
class EX36
{
static void Main()
{
// Write the Main Program for EX36 here...

//String s = "radar";
//string r=s.Substring ()
string s;
//int i;

Console.WriteLine("Enter a string:");
s = ISSConsole.ReadString();

Console.WriteLine(s.Length);

Console.WriteLine(s.ToLower());

//char[] c = new char[] { ' ', '.' };
string []r = s.Split (' ');

Console.WriteLine(r);


for (int i = 0; i <= s.Length-1;i++ )
{


if ((s.Substring(0, 1) == s.Substring(4, 1)) && (s.Substring(1, 1) == s.Substring(3, 1)))
{
Console.WriteLine("Palindrome");
}
}



//string l = s.Substring(1, 1);
//Console.WriteLine(l);
//string m = s.Substring(2, 1);
//Console.WriteLine(m);
//Console.WriteLine(s.CompareTo(r));
//if (s.Equals(r))
//{
// Console.WriteLine("Palindrome");
//}


#region /* Do not remove this or write codes after this */
ISSConsole.Pause();
#endregion
}
}
}

No comments:

Post a Comment