Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
How to remove all characters (in my case numbers and dots) before any first letter of a string?

I have strings for example: "1. Hearing records (Tbr.1.t.4.)" or "23. Appointment details (Tbr.2.t.2.)".

I want to get "Hearing records (Tbr.1.t.4.)" and "Appointment details (Tbr.2.t.2.)".

How can I achieve this with javascript, preferably vanilla? I want to remove all characters (numbers and dots) that appear before the first letter, but after that leave everything unchanged.

Thank you

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Step by step :

  1. Find first index of the character you are looking for.
  2. Get substring from string after the index (with some manipulation).

let s = "1. Hearing records (Tbr.1.t.4.)";
let indx = s.indexOf('.');
s = s.substring(indx+2);
console.log(s);

about 4 years ago · Juan Pablo Isaza Relatório

0

You mean something like that?

let txt = "1. Hearing records (Tbr.1.t.4.)"
let newText = txt.replace(/\d+\.\s/g, "");
console.log(newText )

about 4 years ago · Juan Pablo Isaza Relatório

0

const cases = ['1. Hearing records (Tbr.1.t.4.)','23. Appointment details (Tbr.2.t.2.)']

const filtered = cases.map((item)=>{
  return item.split('.').slice(1).join('').trim()
});
console.log(filtered)


const word = "1. Hearing records (Tbr.1.t.4.)";
console.log(word.split('.').slice(1).join('').trim())

I hope it will work. Cheers :)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda