HISE Logo Forum
    • Categories
    • Register
    • Login

    String Concatenation Using the '+' Operator

    Scheduled Pinned Locked Moved Solved Scripting
    3 Posts 2 Posters 185 Views
    Loading More Posts
    • 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.
    • M
      Mighty23
      last edited by

      Hello, I have a very simple question but I can't seem to find the answer. I would like to concatenate two strings using the '+' operator. I understand that for many this may seem a bit trivial, but I'm stuck on the syntax.

      lblMsLeft.set("text", Engine.doubleToString(value, 0)); 
      

      In this line of code, I've transformed the milliseconds value into a string to obtain 0 decimals. Now, I'd like to append the string 'ms' to the converted string value.

      Free Party, Free Tekno & Free Software too

      ulrikU 1 Reply Last reply Reply Quote 0
      • ulrikU
        ulrik @Mighty23
        last edited by ulrik

        @Mighty23

        this is with a space before the suffix
        lblMsLeft.set("text", Engine.doubleToString(value, 0)+" ms"); 
        
        without a space before the suffix
        lblMsLeft.set("text", Engine.doubleToString(value, 0)+"ms"); 
        

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        M 1 Reply Last reply Reply Quote 1
        • M
          Mighty23 @ulrik
          last edited by

          @ulrik "Thank you for taking a few minutes to address my issue. I understand it was a very simple matter, but I was stuck on the syntax. Thanks again."

          Free Party, Free Tekno & Free Software too

          1 Reply Last reply Reply Quote 0
          • M Mighty23 marked this topic as a question on
          • M Mighty23 has marked this topic as solved on
          • First post
            Last post

          40

          Online

          1.7k

          Users

          11.7k

          Topics

          102.1k

          Posts