473,609 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get input as comma and alphabet alone??

14 New Member
Hi,

Im using C# ASP.Net here in the textbox i need to get the input as like follows

,any alphabet or any alphabet,any alphabet for example ,C or C,E like this i want to get the input.The textbox should get only one comma and it should not get any other special characters.it can be either by server side code or by the java script code..How should i do this any assistance plz..



rgrds



Kanna..
May 8 '07 #1
1 1766
acoder
16,027 Recognized Expert Moderator MVP
You'll want to use a regular expression for this.

Read about regular expressions here.

However, your validation should be on both the client side and the server side (in case javascript is disabled).

Does your string have to be case-sensitive, i.e. does it matter if the letter is lower-case?

A possible regular expression:
/^([A-Z])?,[A-Z]$/
May 8 '07 #2

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

Similar topics

5
2502
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start code snipit** Dim strCustFullName as string Dim strCustAddr1 as string
2
1604
by: Atlas | last post by:
Thank you, this problem has bothered me for several years. I want to extract words from an input file stream. Once a word, ifstream should use the operator >>. But by default, it's delimited only by white spaces. I need it to consider all non-alphabet as delimiters. For example, input "Hello, year 2005's halloween!", will be extracted one by one as: hello year s halloween In c, I can use char *strtok( char *strToken, const char...
12
14569
by: one | last post by:
greetings i am just wondering if some expert here can either show me how to do this or point me to the right direction (url... i want to use c# to generate a list of alphabet e.g A B C ... AA AB AC AD ... AAB ... ZZZZY ... ZZZZ any suggestion will be greatly appreciated thank you
8
3253
by: Jack Addington | last post by:
I want to scroll through the alphabet in order to scroll some data to the closest name that starts with a letter. If the user hits the H button then it should scroll to the letter closest to H. If no one exists with H, then go to I, etc. If its near the end, say 'V', and the last person is a 'T' then it should work its way back up the alphabet. I was trying to loop as if the Char's were ints but I am having problems I have buttons...
31
2652
by: Joe Smith | last post by:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789" " " "!#%^&*()-_" "+=~\|;:\'" "\"{},.<>/\?" "\a\b\f\n\r\t\v\\" Do the above string literals comprise an alphabet for C? joe
0
2964
by: rockdale | last post by:
Hi, all: I implemented an alphabet list so that when user click letter A then I will re-bind a gridview control using SQL stored procedure. It works fine. The problem is I populate my alphabet repeater by select the ini of name from database. So that my alphabet does not have 26 letters, my customer does not like it since it may spell something bad. Now I am trying to display 26 letters, letters that exist in my database will be...
1
2032
by: hygum | last post by:
I've found a useful script that only accepts numbers and a point, and 3 decimals, in an input. But here in denmark we normally use comma as decimal delimiter in numbers, not the point (.) as in english-speaking countries. Can somebody help me making this javascript accept comma as delimiter in the input? I'm thinking that the best solution is that the script converts comma to a point, when the user input a comma. ...
20
19019
by: geebanga88 | last post by:
HI i have a method that is supose to store the alphabet in an array however dont think that it is being added to the array. public static void GetAlphabet (char alphabet) { int index, ordinalVal = 97; char element; for (index = 1; index < alphabet.length; ++index, ++ordinalVal) { element = (char) ordinalVal;
14
4801
by: jld730 | last post by:
All, I will have a user input a string that is either 10, 14, 17 characters long, or contains a comma (of any length). The script proceeds from there depending on the length entered. When I test with the various acceptable lengths or containing a comma, the script works. However, if I put in an unacceptable length (and without a comma), I keep getting the 'to LL model' print statement instead of the 'Unacceptable entry -- bailing out!'...
0
8091
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5524
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.