Oct 8, 2018 #1 lavadan Programmer Dec 17, 2007 49 US I have a string that can have N number of /. How can I find how many slashes my string has? Apple/Banana/Peach -2 slashes Cow/Milk - 1 slash abc/xyz/per/wsl/pol -4 slashes How can find the # of slashes?
I have a string that can have N number of /. How can I find how many slashes my string has? Apple/Banana/Peach -2 slashes Cow/Milk - 1 slash abc/xyz/per/wsl/pol -4 slashes How can find the # of slashes?
Oct 8, 2018 #2 Andrzejek Programmer Jan 10, 2006 8,509 US You may get some good ideas from this place: Number of times a particular character appears in a string which is pretty much: [tt] SELECT LEN(MyString) - LEN(REPLACE(MyString, '/', '')) AS NoOfSlashes [/tt] ---- Andy There is a great need for a sarcasm font. Upvote 0 Downvote
You may get some good ideas from this place: Number of times a particular character appears in a string which is pretty much: [tt] SELECT LEN(MyString) - LEN(REPLACE(MyString, '/', '')) AS NoOfSlashes [/tt] ---- Andy There is a great need for a sarcasm font.