Convert to Pascal Case

Convert a string to PascalCase format, capitalizing each word and removing separators.

Code

General
import re
return ''.join(word.capitalize() for word in re.split(r'[-_\s]+', str))

Parameters

The string to convert to PascalCase

Server

More Python Snippets