I have two string array i want to sort both arrays with corresponding value.
string
the values are
5:2000a
6:3000
1:2000b
strind Id contain value 5,6,1
string yearcount contain values 2000a,3000,2000b
i want the output like this
strind Id 5,1,6
string yearcount 2000a,2000b,3000
and imp thing is without using array.sort() function.
please any one help as soon as possible, its very urgent.

VulpesRank #55 · 29.2K reputationPosted Jan 27, 2012, 12:19 AM EST
VulpesRank #55 · 29.2K reputationPosted Jan 25, 2012, 3:54 AM EST
Pavi S36 reputationPosted Jan 26, 2012, 6:06 PM EST
Pavi S36 reputationPosted Jan 27, 2012, 12:28 AM EST
Great, i too find out the answer in the another way. really thanks for your reply.
My code
========
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Buble_Sort_String
{
class Program
{
static void Main(string[] args)
{
string[] s = { "2000a", "2003", "2000b", "2005" };
string[] Id = { "20", "30", "25", "15" };
string temp = string.Empty;
try
{
for (int j = 0; j < s.Length - 1; j++)
{
if (s[j].CompareTo(s[j + 1]) > 0)
{
temp = s[j];
s[j] = s[j + 1];
s[j + 1] = temp;
temp = Id[j];
Id[j] = Id[j + 1];
Id[j + 1] = temp;
}
}
for (int i = 0; i < s.Length; i++)
{
Console.WriteLine(s[i] + " ");
Console.WriteLine(Id[i] + " ");
}
Console.ReadKey();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
VulpesRank #55 · 29.2K reputationPosted Jan 27, 2012, 12:54 AM EST