pramod_yg
Ten Centuries
Points: 1005
More actions
October 29, 2009 at 10:24 pm
#139717
Dear All,
I need to find the number of "~" present in a string. Is there any inbuilt function to do the same?? if not, can you please help me to achieving that?
Pramod
diamondgm
SSCrazy
Points: 2824
October 29, 2009 at 11:52 pm
#1072952
Copied & adapted from http://www.sqlservercentral.com/Forums/Topic811310-338-1.aspx
This is not my code, I learned something new here.
SELECT (LEN(@string) - LEN(REPLACE(@string, '~', '')))
Atif-ullah Sheikh
SSChampion
Points: 12495
October 30, 2009 at 3:41 am
#1072992
Duplicate post. Already answered this question in another post.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply