Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Forms
hi sir/madam
 
may i know how to find the range of array elements by enter the values in Textbox like 3,45,76,24,43. that result will display in other textbox. is this possible?
 

thank u.
Posted 1-Jul-13 22:50pm
radha18301
Comments
Denis Shemenko at 2-Jul-13 3:55am
   
Hi!
What you mean by "range" of array?
Maybe length?)
radha18 at 2-Jul-13 3:58am
   
yes, its length
jaideepsinh at 2-Jul-13 3:57am
   
Sorry,
But can you explain in brief what you want to do.If you want to know size of array then its depend on datatype which you use.
radha18 at 2-Jul-13 4:03am
   
i am taking in textbox so its text format. how we remove that comos and how to find length of that array. and display in another textbox.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If length then this is very simple:
 
// You take your input value as string
string input = textBox_1.Text;
// Then you split this string with those character that you choose
// and you've got array of strings
string[] arr = input.Split(',');
// And for the end you output array length in the second text box
textBox_2.Text = arr.Length;
  Permalink  
Comments
radha18 at 2-Jul-13 5:01am
   
thank u so much for clarifying.
Denis Shemenko at 2-Jul-13 5:03am
   
You are welcome :)
radha18 at 2-Jul-13 5:51am
   
now the array is stored into string format but how to convert the string array to integer array. then how to find the biggest and smallest element among those elements. and print that in another textbox.
Denis Shemenko at 2-Jul-13 7:48am
   
Just convert all items in array through the loop into Integer.
About loops - http://www.dotnetperls.com/loop
About converting - http://msdn.microsoft.com/en-us/library/vstudio/bb397679.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 539
1 Maciej Los 300
2 DamithSL 233
3 Sergey Alexandrovich Kryukov 209
4 BillWoodruff 200
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 2 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100