for my project I want to show credit card numbers on a template.
From my API i get credit card number like "4242424242424242" but i need to reformat this numbers with space like this "4242 4242 4242 4242".
I read some topics but people always explaining with textfield or something like this. I have 16 chars long string variable and i need to reformat this to 19 chars long string with spaces.
I dont need any validation just want to make string with spaces.
As a result i need to turn this string "4242424242424242" to "4242 4242 4242 4242" this string.
Last edit: First of all thank you for all answers, i am sorry for asking questions that already asked.