简体   繁体   中英

Remove part of string coming from database

This usuario.get(3) get from database the string "202019" but on the screen I get only 19 .

Assert.assertEquals(usuario.get(3), pedidoPage.obterCicloConsultora(driver));

I want remove "2020" to make my assertion works.

Please, help me !!! Thank you !!!

You can use

Assert.assertEquals(usuario.get(3).substring(4), pedidoPage.obterCicloConsultora(driver));

If the method usuario.get(int) returns a String, you can try:

usuario.get(3).replace("2020","")

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM