Add new function to stringmethods.php

Signed-off-by: Marcin Pyrka <pyrka.marcin@gmail.com>