Click here to Skip to main content
13,094,983 members (80,042 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 21:50pm
Denis Shemenko 2-Jul-13 3:55am
What you mean by "range" of array?
Maybe length?)
radha18 2-Jul-13 3:58am
yes, its length
jaideepsinh 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 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 2-Jul-13 5:01am
thank u so much for clarifying.
Denis Shemenko 2-Jul-13 5:03am
You are welcome :)
radha18 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 2 Jul 2013
Copyright © CodeProject, 1999-2017
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