Javascript Encoding spacing

how to fix this problem

myStr should have encoded text with the proper escape sequences and no spacing.

Hi @Adib12,

Have you looked at “encodeURI”?
Please see link below for the MDN documentation on it. This might lead you in the right direction.