<<I'm actually a little curious as to why you'd want to do this. Typically one uses tools like PHP to get away from such low-level string manipulation. But I realize that that's just what you may want to do, so if it is, feel free to disregard everything below =) >>
I am a long-time C programmer, so I tend to think of C-style solutions first.
<<If what you want is string2, you could use explode() on the string, a la
$parts = explode(":", $string);
which, if $string is set as your example, will give you $parts[0] == "string1" and $parts[1] == "string2"; >>
There's no guarantee that ':' won't appear in the rest of the string. explode() would then break that string up, which would be undesireable. I could glue the parts back together, of course.
The big problem is that the string will actually be of the form:
field1: some stuff
field2: some other stuff
.
.
.
fieldn: final stuff
I guess I could work it morewith explode(), and break the first string on the line breaks, then process each substring