Get the number of indents levels from the current line

string:get_indent_level(STRING $line, INT $spaces_per_tab=4) : INT

string:get_indent_level("hi")
#=> 0

string:get_indent_level("  hi")
#=> 0

string:get_indent_level("    hi")
#=> 1

string:get_indent_level("    \t\thi")
#=> 3

Copyright ©2013-2022 SunSed®. All rights reserved.