Count a certain word in a string

Hi there, i was wondering how i could count the number of times a certain word is used in a string? i cant seem to figure this out, is there a function for this?