-1

They send me a text file that starts with unnecessary information and then what is needed goes further. How to remove the beginning to a specific symbol.

Example: line = 'lots of text {text needed}';

It is necessary to delete everything before the symbol {. I tried the regular expression option below:

let str = /^[^{]+/.exec(line)[0];

but it returns the beginning of the text to the symbol { I need to do the opposite

Thanks for any help

Harvey
  • 562
  • 1
  • 7
  • 21
ivkor
  • 13
  • 1

1 Answers1

-1

This is how you can do with JavaScript.

var str = 'lots of text {text needed}';
str = str.substring(str.indexOf("{") + 1);
console.log(str);
Bhavik Kalariya
  • 1,231
  • 3
  • 18