Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by irq-1

23 days ago

Note on example of UTF-8 strings. It's counting " has " in the length. You can change it to:

    let l = text.len();
    text.push_str(" has ");
    text.push_usize(l);

1 comment

irq-1

Reply

jordan_bonecut  23 days ago

I’ll look into this

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities