I am currently receiving data from the backend, a string of numbers (accountNumber), which has 10 digits, and is specific to each user. where the first is 1, then 0... and lastly the accountNumber (it can contain 1 digit or more) Ex: 1000000032 / 1000002032 / 1000000004. The idea is to return this string with the digits of the accountNumber in bold, Ex: 10000000 32 / 100000 2032 and so on. What I tried so far : Using this as ex: 1000002032
const clean = accountNumber.substring(1, 10) ==> '000002032'
const showOnlyAccountNumbers = clean.replace(/^0+/, ''); ==> '2032';
const transformToArray = showOnlyAccountNumbers.split();==> ['2032']
const boldNumbers = showOnlyAccountNumbers.map((each) => {
return <b>{each}</b>
}) ==> {[...]}
I am not getting the result since the .map returns an array of objects and not what I need to be able to somehow join that in a string with the rest.
First of all, Thanks !