In Azure DevOps YAML pipelines there are several functions available for you to use. replace is such a useful function, which you can use to replace string segements within a string. Let's look at how we can use replace function to replace contents of a variable.
Use case would be: For example you have a variable value for your customer api name as cutomer-api. You may need to use it and generate customer_api value for another variable which you want to use in a namig of resouce, for consitency purpose with _ in naming instead of -.