How to edit a string via slice

BlitzMax Forums/BlitzMax Beginners Area/How to edit a string via slice

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

What im try to do, is edit a string via slice access - is it possible?

Function fiddle:String(orgstring:String)
  Local modstring:String=orgstring

  modstring[4]=byte(100)   'How the write to a sliced string?

  Return modstring
  End Function

'main program
stringy:String="something"
Print stringy
stringy=fiddle(stringy)
Print stringy
End

It says "Compile Error - Expression must be a varible"
Well I guess im doing something wrong, so what is it?