Extracts the currency symbol from a price string. Uses Unicode property escapes to match currency symbols. Supports a wide range of international currency symbols.
The price string to extract the currency symbol from
The currency symbol if found, undefined otherwise
getCurrencySymbol('$1000') // Returns '$'getCurrencySymbol('1000€') // Returns '€'getCurrencySymbol('£99.99') // Returns '£'getCurrencySymbol('¥10000') // Returns '¥'getCurrencySymbol('₹1500') // Returns '₹'getCurrencySymbol('1000') // Returns undefined (no symbol) Copy
getCurrencySymbol('$1000') // Returns '$'getCurrencySymbol('1000€') // Returns '€'getCurrencySymbol('£99.99') // Returns '£'getCurrencySymbol('¥10000') // Returns '¥'getCurrencySymbol('₹1500') // Returns '₹'getCurrencySymbol('1000') // Returns undefined (no symbol)
Extracts the currency symbol from a price string. Uses Unicode property escapes to match currency symbols. Supports a wide range of international currency symbols.