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

183
Visualizações
cut string after certain number of words javascript

I want to cut this paragraph after certain number of words, not characters

const Text = "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you"

For instance: if i do

Text.substring(0,50)

the output will be

'But I must explain to you how all this mistaken id'

the word "idea" is cut and is not what I want, i want the whole word and then maybe add " . . . "

example 'But I must explain to you how all this mistaken idea . . .'

about 4 years ago · Juan Pablo Isaza
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