Posted by **Crystal** on Monday, November 2, 2009 at 11:25pm.

Is there a method in Java in which to see if an integer value contains characters?

- Java -
**MathMate**, Tuesday, November 3, 2009 at 6:33pm
By definition, an integer value does not contain characters (apart from the minus sign), otherwise the value is invalid.

If you have a String and would like to check for foreign characters, you can try:

the matches() method using a regular expression.

For example, if you suspect alphabetic characters, you can check using:

if(someString.matches("[a-zA-Z]")

{

// do something

}

If you want to scan for all non-numeric characters, you can replace with

...matches("[^0-9]")...

## Answer This Question

## Related Questions

- programming - write a java application to calculate the exponent value of a ...
- please help java - please help me with that as soon as any bady can ...
- pseudo code algorithm - Convert your algorithm from Question One into a complete...
- java - Write the following methods and test them.this need to be execute it in ...
- java - Write a java application that finds the smallest of several integers. ...
- Java - Can someone please help me out!!!I included what I have so far. *Purpose ...
- Java - What kind of Math do I need to be proficient in in order to be prepared ...
- java programming - Create a java program that will calculate the current grade ...
- JAVA PROGRAMMING - Create a java program that will calculate the current grade ...
- Computer Language Java - What is the concept of multi-threading in java and how ...

More Related Questions