-3

Why is here the ": NLength" needed?

string NLength = JasonCity.Value("name"); Name = (NLength.Length > 30) ? NLength.Substring(0, 25) + "." : NLength;

And here not:

string NLength = JasonCity.Value("name"); Name = NLength.Substring(0, 25) + ".";

What exactly does the colon mean?

c m
  • 1
  • 1
    It's the [Conditional (ternary) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) – cheesyMan May 12 '22 at 06:29

0 Answers0