473,468 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

isDigit & isLetter methods

3 New Member
Character.isDigit() or Character.isLetter() in Java.lang work of course, but I had to make my own solution as homework so here they are:


isDigit method:
Expand|Select|Wrap|Line Numbers
  1. static boolean isDigit(char c) {
  2. return (c <= '9' & c >= '0');
  3. }
isLetter method:
Expand|Select|Wrap|Line Numbers
  1. static boolean isLetter(char c) {
  2. return (c <= 'z' & c >= 'a' || c<='Z' & c>='A');
  3. }
Are there any other solutions for this thing and is mine bound to work in every condition?
Nov 14 '10 #1
0 1571

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

Similar topics

9
by: Bart Nessux | last post by:
I am using method 'a' below to pick 25 names from a pool of 225. A co-worker is using method 'b' by running it 25 times and throwing out the winning name (names are associated with numbers) after...
2
by: Unemployed VC++ guy | last post by:
It seems that there is basically no difference between the Console.Write() & String.Format(), other than the output being sent to the console output stream instead of a string. Is this accurate? ...
1
by: Manuel Maria Diaz Gomez | last post by:
Hi Everybody I would like to implement an interface class (abstract), where the pure virtual method can take any parameter, and leave the actual implementation to the end user. I believe this...
0
by: Zeng | last post by:
I wish the Get & Set methods for a property are separate in C#. It would be nice if I could do the following: class Base { public bool IsFoo { set { m_isFoo = value; } }
4
by: Sadun Sevingen | last post by:
i have SqlParameterCollection and i want to reach it by SET and GET methods... public SqlParameterCollection Parameter this { get { return Command.Parameters; } set
0
by: MARTIN LANNY | last post by:
Hi everyone, To bring you in the picture: I have the function to grab the html content from the page. Function requires only URL and Time Delay variables. Url, which I am submitting to this...
2
by: Dave Mathew | last post by:
I'm trying to run some clientside javascript on page load for one of my ASP.Net pages. I am using the ClientScript.RegisterClient....() methods to register an external javascript file within...
0
by: monkey05 | last post by:
i have a update method for webservice the parameter is passed as dataset. I don't how to call in the gridview in the updating method. I used the objectsource to call that method but the updated...
9
by: mdh | last post by:
Hi All, May I ask this. The exercise 5-1 asks one to correct an input in which a non-digit follows a + or - . T & G show this: /****/ if ( c == '+' || c == '-'){ d=c;
11
by: mdh | last post by:
I wonder if I could ask for help. I have been struggling with this most of the day, and cannot understand what is going on. The problems are (1) it does not work!! (but exits normally on...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
1
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...
0
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.