Force String from variable

Never faced this before. Have the below example. Variable is coming out as a number in the Struct. I thought putting in quotes would make it a string.
Is there a way to force the variable to a string? Javacast? (tw =“44”; works but isn’t the answer I need)

<cfscript>
tw = 44;
myStruct = structNew();
myStruct.number = "#tw#";
writeDump(myStruct);
</cfscript>

Ugh. Found it. toString(tw);

See if toString()does what you are after

https://docs.lucee.org/reference/functions/tostring.html

1 Like

Trim() works too.

2 Likes