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 missing sequence number. Get the numbers where sequence is missing.

Get Query String Values With Javascript