It's similar to the bitmapfont function.
Let's assume you have an image with two tiles in it. Now you can load your image with
mytile=loadtileset ("image.png",1,2,"ab")
or if you already loaded the image
mytile=tileset(image,1,2,"ab")
The string is similar to the fontface of a bitmapfont, so if you want to draw the first tile you do the following:
drawtile (0, 0, "a", mytile)
the second tile
drawtile (0, 0, "b", mytile)
or a longer line (with both tiles)
drawtile (0, 0, "aaabbaabbbbaaaabbaaa", mytile)
It's not very nice as you can see, I recommend it only for background drawing where no tiles are changing because string manipulation is slower than using numbers. (And of course you are limited to a string which means if you are using the alphabet you can handle with upper and lower case 52 tiles.)