On Saturday, 26 October 2013 at 21:23:13 UTC, Gautam Goel wrote:
Dumb Newbie Question: I've searched through the library reference, but I haven't figured out how to extract a substring from a string. I'd like something like string.substring("Hello", 0, 2) to return "Hel", for example. What method am I looking for? Thanks!
Use slices: string msg = "Hello"; string sub = msg[0 .. 2];