Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to remove specific character from QML string?
Forum Updated to NodeBB v4.3 + New Features

How to remove specific character from QML string?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CuriousPan
    wrote on 5 Aug 2021, 17:08 last edited by
    #1

    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?

    E 1 Reply Last reply 5 Aug 2021, 17:58
    0
    • C CuriousPan
      5 Aug 2021, 17:08

      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?

      E Offline
      E Offline
      eyllanesc
      wrote on 5 Aug 2021, 17:58 last edited by
      #2

      @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);
      

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      2

      1/2

      5 Aug 2021, 17:08

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved