The function of sacnf is to read the string. It reads and detects the presence of whitespaces in a string. Upon reading, it encounters the whitespaces such as any space, new line, newly added tab, etc. After detection, it stops the usage of any whitespace which is not included in the format of a string.