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

Get Query String Values With Javascript

Change Css Class of li in ul onclick

Change Text Color with Javascript