espnet2.utils.types.remove_quotes
Less than 1 minute
espnet2.utils.types.remove_quotes
espnet2.utils.types.remove_quotes(value: str)
Remove surrounding quotes from a given string.
This function takes a string input and removes leading and trailing quotes (if they exist). It supports both single and double quotes.
- Parameters:value (str) – The input string from which to remove quotes.
- Returns: The input string without leading and trailing quotes.
- Return type: str
Examples
>>> remove_quotes('"Hello, World!"')
'Hello, World!'
>>> remove_quotes("'Python is great'")
'Python is great'
>>> remove_quotes("No quotes here")
'No quotes here'
>>> remove_quotes('"Quotes" and more "quotes"')
'Quotes" and more "quotes'