Passing a user defined string to the wavelist command

Does any one know if it is possible to pass a user defined string to wavelist?
I have tried
waves_to_move = WaveList("($wavewithnames)",";","")
waves_to_move = WaveList("$wavewithnames",";","")
but neither work.
Any ideas on how to get round this?
Try:

String wavewithnames = "some string"
String waves_to_move
waves_to_move = WaveList(wavewithnames,";","")


I'm assuming you have already declared the strings wavewithnames and waves_to_move in your function, but I added them above just to make it clear that you need to do that.
Ha!
Yeah strings were already declared. Slightly annoyed with myself for not thinking of that, but it worked first time.
Thanks for that.