emmanuellamy
05-29-2003, 03:29 AM
Hi everybody,
Does Javascript have a built-in function to search for, and return the count of a specific character or substring in a string? If not how can one approach the problem of extracting some substring starting from a certain point defined by the nth position of a specific character or substring within the string in question. For instance I want to extract a substring that would start after the third word in a string. To do that, I'd want my codes to calculate the position of the 3rd " " space character of the string. How do I do that? I couldn't find a way out with the indexOf and lastIndexOf methods. Thanks for any tip.
Emmanuel
Does Javascript have a built-in function to search for, and return the count of a specific character or substring in a string? If not how can one approach the problem of extracting some substring starting from a certain point defined by the nth position of a specific character or substring within the string in question. For instance I want to extract a substring that would start after the third word in a string. To do that, I'd want my codes to calculate the position of the 3rd " " space character of the string. How do I do that? I couldn't find a way out with the indexOf and lastIndexOf methods. Thanks for any tip.
Emmanuel