.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Fix lenth for array dimention

Posted By: Catherine     Posted Date: June 10, 2011    Points:5   Category :C#
Hi I am using array like this string[] strstring = new string[4];

now i would like to do if(strstring[2].length=5)

if this condition true only i would like to process other thing

but it is not working.the third array should be 5 character. please tell

Author: Gowthammanju             
Posted Date: June 10, 2011     Points: 20   


go through this link


whick might help u

Thanks & Regards,

Mark if the answer is true
Author: SureshM             
Posted Date: June 10, 2011     Points: 20   

Hi Catherine ,

If you set the array size is 4, array index will be like this: strstring[0].,.,.strstring[3]

I think you, u need to check the length of the second index. so use like this strstring[1]

if(strstring[1].Length == 5)
//do ur process here.

Author: Sasi Prabhu             
Posted Date: June 10, 2011     Points: 20   

it works fine...
use breakpoint and check the runtime value...

Thanks & Regards,
Sasi Prabhu.

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend