It's a simple way to use "Replace" function in twig file just go through simple method:
Syntax with example:
{#
*** replace '-' with '$' sign in vidyard ID ***
#}
{% set twig_content_variable = node.field_resources_vidyard_id.value %} //field_resources_vidyard_id is are vidyard id field
{% set replace_value_var = '-' %}
{% set replace_with_value_var = '$' %}
{% if twig_content_variable %}
{% set vidyard_function_id = twig_content_variable|replace({ '-': '$' }) %}
{% endif %}
Note: How to replace function use in Twig template?
Syntax with example:
{#
*** replace '-' with '$' sign in vidyard ID ***
#}
{% set twig_content_variable = node.field_resources_vidyard_id.value %} //field_resources_vidyard_id is are vidyard id field
{% set replace_value_var = '-' %}
{% set replace_with_value_var = '$' %}
{% if twig_content_variable %}
{% set vidyard_function_id = twig_content_variable|replace({ '-': '$' }) %}
{% endif %}
Note: How to replace function use in Twig template?