I am going to use a label in Apex code and compare it with another String variable. Example: Comparison

Label.MyLabel == MY_VARIABLE;

Do I need to first convert the label to String before comparing? If yes, how to do it?

  • No your label will return String only.
    – Ratan Paul
    Feb 16 '16 at 10:47
  • I haven't tried to compile yet. Was just thinking of a solution approach and had this question. Thanks for replying!
    – ajinkyah
    Feb 16 '16 at 12:36

Don't need to convert Label into String. All Labels are in String and compare with other String variable.

Have you get any error while doing this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.