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?

How to remove specific character from QML string?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 2.9k 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 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?

    eyllanescE 1 Reply Last reply
    0
    • C CuriousPan

      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?

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on 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

      • Login

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