Click here to Skip to main content
Rate this: bad
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
Denis Shemenko at 2-Jul-13 3:55am
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
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
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;
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 -
About converting -

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 434
1 OriginalGriff 380
2 CHill60 240
3 Abhinav S 220
4 CPallini 220
0 Sascha Lefévre 75
1 OriginalGriff 70
2 F-ES Sitecore 55
3 Peter Leow 50
4 Dave Kreskowiak 40

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 2 Jul 2013
Copyright © CodeProject, 1999-2015
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