You could use an if inside a for loop to find the /. Then just use another for loop to copy the string and use an if to see if you are before or after