New truncate and truncateWords methods

New truncate and truncateWords methods, resolves #2941