How to remove specific character from QML string?
-
wrote on 5 Aug 2021, 17:08 last edited by
Writing a program I encountered a small problem. I would like to remove last character from QML string but I don't see a way to do it. Is this functionality implemented or should I deal with it in my own way?
-
Writing a program I encountered a small problem. I would like to remove last character from QML string but I don't see a way to do it. Is this functionality implemented or should I deal with it in my own way?
wrote on 5 Aug 2021, 17:58 last edited by@CuriousPan See https://stackoverflow.com/questions/952924/javascript-chop-slice-trim-off-last-character-in-string
let str = "hello word"; str = str.substring(0, str.length - 1); console.log(str);
OR
let str = "hello word"; str = str.slice(0, -1); console.log(str);
1/2