Sunday, May 24, 2009

String Exercise

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

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

namespace Method
{
class Exercise45
{
static void Main()
{
// Write the Main Program for Exercise45 here...
string s1 = ISSConsole.ReadString("Enter the value of first string:");
string s2 = ISSConsole.ReadString("Enter the value of second string:");
Console.WriteLine("Return value:" + FindWord(s1,s2));
#region /* Do not remove this or write codes after this */
ISSConsole.Pause();
#endregion
}
static int FindWord(string s1,string s2)
{
int i;

for (i = 0; i < s1.Length; i++)
{
//s1.CompareTo(s2);
if (s1.CompareTo(s2) == 0)
{
Console.WriteLine(s1.Length);

}
}
// return find;
return s1.Length;

}


}
}

No comments:

Post a Comment