• @Lmaydev
    link
    9
    edit-2
    5 months ago

    It has a not keyword it’s used for pattern matching.

    if (x is not null)
    
      • @Lmaydev
        link
        25 months ago

        Pattern matching is different.

          • @Lmaydev
            link
            1
            edit-2
            5 months ago

            The type matching is the most common thing I use it with. Combined with inline variables.

            if (x is string { Length: 5} s)
            {
                // do stuff with s
            }
            

            And switch expressions.

            As a side note inline variables are amazing haha