Skip to content

How to remove slint::SharedString last char in slint-ui? #6380

Answered by ogoffart
fluolite asked this question in General
Discussion options

You must be logged in to vote

This feature is currently missing.
You'll have to do that in native code

It's also missing on SharedString rust though
something like so should work:

let ch = the_string.chars().rev().next()?;
let newlen = the_string.len() - ch.len_utf8();
the_string = the_string[..newlen].into();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fluolite
Comment options

Answer selected by fluolite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants