DeeW. Posted June 7, 2015 at 10:25 PM Report #584443 Posted June 7, 2015 at 10:25 PM Olá pessoal, queria saber se é possivel quebrar uma string e deixar apenas o número nela, tentei usar .split() do jQuery, mas sem resultados, o que eu quero quebrar é tipo isto: /a1-abcde
Solution HappyHippyHippo Posted June 8, 2015 at 12:46 AM Solution Report #584450 Posted June 8, 2015 at 12:46 AM o que tu queres não é "quebrar" a string mas obter o valor numérico existente pelo meio da string. a maneira mais imples é usando expressões regulares: var str = "/a1-abcde"; var pattern = /\d+/; car matches = pattern.exec(str); 1 Report IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
DeeW. Posted June 10, 2015 at 05:02 PM Author Report #584630 Posted June 10, 2015 at 05:02 PM Obrigado amigo, funcionou corretamente! Like+ []'s
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now