How do I search a string in a byte array?

I like to return the index of the first occurence of the string in the byte array.


Also is there a way to return the end index of the first occurence of the string in the byte array.