variable string for sprite

hello, ive got a string that changes from cow1 to cow4 etc, and i have a sprite that calls this string.
the problem im having is not being able to keep the " mark inside the string such that it carries forward to the sprite.

the code looks something like this :

stringcow = “Dropbox:cow”. . value

(value is some random number)

sprite(stringcow, width/2,height/2)

this does not work because i cant seem to keep the quotation marks in stringcow. is there any body who have an easy solution to this?

ive tried doing stringcow = “”" . . “Dropbox:cow”. . value . . “”"

but of course this doesnt work.

i found the solution it is


good day

although now i can input a string that looks like
into the sprite, the sprite doesnt acknowledge that this is a sprite call, is it then not possible to do this? il just use a if statement if that is the case…

.@archistudent you shouldn’t keep the quotation marks in stringcow. The following should work (presuming Dropbox:cow1 exists):

local cowSprite = "Dropbox:cow"

sprite( cowSprite .. 1, WIDTH/2, HEIGHT/2 )

That should draw “Dropbox:cow1”

thanks that worked.