Camunda 7.18 giving getting null unicode '\u0000' .replace() method of java while using it in camunda expression

Hi there,
Recently we are getting \u0000 null character after this operation is performed in camunda ${variable.toString().replace(" ","")} this is replacing empty spaces with null characters ideally this should not occur.

We checked xml, bpmn xml doesn’t contain any unicode or null character in it

Please any help would be appreciated.
Thanks