title: Cypress - delete text from const
body: <p>I need to help. I have code that is controlling if some value is greater than other value.</p>
  
  <p>It looks like this:</p>
  
  <pre><code>cy.get(':nth-child(1) &gt; .offer-block &gt; :nth-child(1) &gt; .flex-col &gt; .offer-price').then(($span) =&gt; {
          // capture what num is right now
          const num1 = $span.text();
  
          cy.get(':nth-child(2) &gt; .flex-column').click();
          cy.wait(5000);
          cy.get(':nth-child(1) &gt; .offer-block &gt; :nth-child(1) &gt; .flex-col &gt; .offer-price').then(($span) =&gt; {
            // now capture it again
            const num2 = $span.text();
  
            // make sure it's what we expected
            expect(num1).to.be.greaterThan(num2);
          });
      });
  </code></pre>
  
  <p>Problem is that saved text isn't only simple number but it allways ends with " Kč". Is there some way to delete this text (" Kč")?</p>
  
  <p><a href="https://i.stack.imgur.com/IRZfh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IRZfh.png" alt=""></a></p>
  
  <p>I was trying to parse text to float but it didn't end well.</p>
  
  <p>Thanks for all your help.</p>