“Jak znaleźć numer w ciągu JS” Kod odpowiedzi

Jak znaleźć numer w ciągu JS

// To find a number in a string
const str = "sdfh0d5f6"
const result = str.match(/\d+/g)

console.log(result)
// ['0', '5', '6']
Radmehr Aghdam

JavaScript Znajdź numer w ciągu

the regular expression on looks for the first number character in the string

let numberInString = theString.match(/\d+/[0];
McBurd

Odpowiedzi podobne do “Jak znaleźć numer w ciągu JS”

Pytania podobne do “Jak znaleźć numer w ciągu JS”

Więcej pokrewnych odpowiedzi na “Jak znaleźć numer w ciągu JS” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu