Remove Numbers From Strings @gleb
Remove Numbers From Strings  @gleb
Uploaded July 2023 | Updated September 2026, 1 week ago
This video shows how to take multiple elements, remove numbers from each text, trim those strings, and confirm them.
cy.get('#fruit li') // jQuery Element[]
.map('innerText') // string[]
.mapInvoke('replace', /[\d\s]/g, '') // string[]
.should('deep.equal', ['Apples', 'Grapes', 'Kiwi'])
The retryable query commands "cy.map" and "cy.mapInvoke" come from my plugin github.com/bahmutov/cypress-map The full example is at glebbahmutov.com/cypress-examples
Remove Numbers From StringsCustom Assertion Catches Elements Overflowing The ContainerLesson d2: Halloween pumpkinscypress-if Plugin Supports Cypress v12+: Close The Popup Dialog If It Is VisibleSelect DOM Elements Using CSS OR SelectorTest AG Grid Table Using Cypress And Cypress-Map PluginFind Table Column IndexHow I Create Page Objects (In Cypress)Chai Nested Property Assertion In Cypresscy.difference Command With PredicatesConfirming Multiple Data- Values Using DOM Element DataSet PropertyClick In Parallel
gleb bahmutov |

Remove Numbers From Strings

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER