473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to compare value with the same textbox in C#?

I have a text format like this:
12-22-24-22-33-13
when user click a button then check for duplicated number in that text.
how to handle this in C#.
Jan 26 '15 #1
1 1382
Frinavale
9,735 Expert Mod 8TB
You could split the string on the "-" character.

Then loop through the array that results from the split and look for any duplicates either by using regular expressions to search for the text/number or by looping through the results a second time (skipping the index you are currently on or taking into account that you will have at least 1 match because the item you are looking for is definitely in the string) to see if there are any others that match.


-Frinny
Jan 27 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: VB Programmer | last post by:
In my ASPX page how do I get the .text value of a textbox that is in the ItemTemplate of a datalist (using HTML)? The textbox contains the quantity for a shopping cart item. The textbox is...
2
by: deancarstens | last post by:
Hi, I'm a novice with VB and I've written this pretty simple script, but for the life of me, I can't get the last bit of the script to work. It should compare the value entered by the user...
5
by: Tradeorganizer | last post by:
Hi, I have a database with table name as test in that i have 6 colums they are name varchar (20) address varchar (20) position varchar (20) nametype1 varchar (20) nametype2 varchar (20)
6
by: wilboy | last post by:
Hi I tired to compare the value in same field, eg: Staff ID TranNum 123456 1 122333 1 133222 1 123456 ...
1
by: mesut | last post by:
Hi colleagues, In fact I don't have a problem but just don't know which way is good and better. I need some advice which programming way I shall use. Since a couple of days I'm investing my...
1
by: flormarinkovic | last post by:
Good morning, I have resume my old question for the follow: I have shapes in different folders, and i need to check if the field "Codi_bd" and then i have to compare the value of the fields of...
1
by: varunkumarid | last post by:
Hi to All, I want to Compare the Two Textbox ClientId not a Value of them, whether clientid is equal i perform something oterwise not. for (var i = 2; i <=...
7
by: thomaaxha | last post by:
Hello , i want to compare a value of a variable with all the values in a table column c# and sql server08. if this value is in column do nothing , if it is in the column do sth .. please help me for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.