What is the use of nullif function?

Nullif function contains two parameters.
It returns null values when two expressions are equal, returns the first parameter if not equal.
Eg:
If the first parameter is dotnet and second also dotnet, then the result will be null.
If the first parameter is dotnet and second is funda, then the result will be dotnet.