xxx of yyy characters
Join Group

Linea de Código

Google Translation: Off

When Google Translation is on, topics and messages in this group will be machine-translated to your language by Google.

Messages


Topic: Validar si un dato es numérico con patrones en Java
Mar 31
2:26 PM

Posted by Victor Cuervo

Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  
Muy util tu codigo para validar si un dato es numerico.
Necesito un ayuda, es parecido pero necesito validar si un caracter es una letra, es decir, lanzar una exepcion si ingresa un numero, bueno eso lo puedo hacer, lo que necesito es saber la validacion en JavaSE
Si podrias ayudarm te quedaria muy agradecido.
May 24
3:30 PM


Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  
Hola,

Disculpa no haber contestado antes. La idea sería utilizar patrones.

Un código sencillo sería algo así:

String cadenaUno = "letras";

if (cadenaUno.matches("[a-zA-Z]*"))
System.out.println("Son todo letras");
else
System.out.println("No son todo letras");

De todas maneras me lo apunto y publico un artículo sobre esto lo antes posible.
Aug 8
4:18 AM

Posted by Victor Cuervo

Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  

Title
body