Skip to content
Advertisement

Using Split method or Regex to separate string

In my project I am webscrapping UFC website to gather to the total wins, total losses, and total draws of each UFC athlete.

This is part of my code, as I wish to strip the total wins, total losses, and total draws separately:

JavaScript

The result is the following:

JavaScript

The problem is, I am unable to spew out the total draws. I also tried using the strip method with no avail:

JavaScript

Advertisement

Answer

Try:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement