If statement issues?

Hi Team,

Hoping you can help me… Please excuse my poor use of code as I still battle with learning.

            if "\(entry.comment ?? ""))" != "No Comment" {
      Text(entry.comment ?? "Unknown")
             .font(.custom("Arial", size: 18))

Code above, getting an entry from Core Data and displaying it in a list… I thought the above would … if the entry.comment value had a String as “No Comment” it would not action the code with in the curly brackets.

What and i doing wrong.

I simply want to NOT add the value to the list of it contains the words No Comment.



Thanks !!!

why not just chain the ifs using if else instead of using ??

or maybe consider using switch or guard