var s = "Hello"; // GetSomeString(); var len= s?.Length; var maxLen = 5; var result = maxLen.CompareTo(len); ...