Yep, but it's usually a bad practice to reinvent the wheel when you have an existing one-line solution :)