When you are creating New Folder in SharePoint list through UI, SharePoint automatically trims white-space from folder names. But, if you attempt to create New Folder programatically, an Exception can occur:
This error means: The file name, directory name, or volume label syntax is incorrect. You can simply trim white-space from folder name and the error should be gone.
Currently working as SharePoint Developer combining both back-end & front-end development scenarios. Also enthusiastic about Office 365 & Azure solutions.