Count Number Of Spaces in a String


Hello readers.
Below is a simple query to count number of spaces from a string.

DECLARE @string VARCHAR(200) = 'hello how are you'

SELECT (LEN(@string) - LEN(REPLACE(@string, ' ', ''))) Occurence

Comments

Popular posts from this blog

Change Css Class of li in ul onclick

Find difference pattern of the given sequence.

Get Query String Values With Javascript