JSFiddle - React, Tailwind, and code Playground

JavaScript

var finalUrl = " 191.341.411.314 80";

console.log(finalUrl);   // Before
console.log(finalUrl.replace(/^\s/, '')); // After