javascript - Swap position of number in a 4 digit number without array -


in 4 digit number how swap 1 number 3 , 2 4 number need solve 1 problem in javascript.thank you

try this:

x = '1234'  x.replace(/(.)(.)(.)(.)/,'$3$4$1$2')  result: "3412" 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -