Conditional String Logic

Learn about the usage of the conditional string logic.

Fluent strings provide many different methods for applying conditional logic inline. These methods can help reduce the total amount of code we write, but care should be taken not to do it and therefore, make things much more difficult to understand for the developers who come after us. To start this discussion, imagine we have a function that accepts a universally unique identifier (UUID) argument. If the argument is not a valid UUID, the function would then generate a new one. If the provided UUID is valid, we will use the supplied one instead:

Get hands-on with 1200+ tech skills courses.