Results 1 to 5 of 5

Thread: i'm really sorry for asking so much but last one because twm my exam

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2015
    Posts
    85

    i'm really sorry for asking so much but last one because twm my exam

    i want to make label1.text = label2.text + label3.text + label4.text +label5.text

    its show like that blablablablabalbalbal

    i want it to be like this bla bla bla .

    please help me now today please

  2. #2
    New Member
    Join Date
    Mar 2015
    Posts
    3

    Re: i'm really sorry for asking so much but last one because twm my exam

    Code:
    label1.text = label2.text & " " & label3.text & " " & label4.text & " " & label5.text
    That's how I would do it. You might be able to use '+' instead.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2015
    Posts
    85

    Re: i'm really sorry for asking so much but last one because twm my exam

    thanks a lot

  4. #4
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,390

    Re: i'm really sorry for asking so much but last one because twm my exam

    No do not use +, this is not a mathematical condition. Yehya have you answered the admins question yet before i post.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    35,238

    Re: i'm really sorry for asking so much but last one because twm my exam

    Using + to concatenate strings will work, but as Ident suggests, it's dangerous. The best operator to use for strings is & rather than +. The reason is that + also adds numbers. With Option Strict OFF, the behavior of + when concatenating strings is kind of up to the discretion of the compiler, which has been set up to guess right a bit more often than not, but when it comes to + as a concatenation operator, it may guess wrong enough times to cause you trouble. Using & avoids any potential surprises.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width