Jump to content

Exception thrown when title begins or end with space character

Recommended Posts

If you try and set the title to a note to a string that has beginning or trailing spaces you get the following exception:


If you take the sample C# cloud SDK program and modify the text of one of the titles of the new notes to add a trailing space and run it you will get the following:

System.ArgumentOutOfRangeException occurred
  Message=Index and length must refer to a location within the string.
Parameter name: length
  Source=<Cannot evaluate the exception source>
   at System.String.Substring(Int32 startIndex, Int32 length)
   at EvernoteSDK.String_ENScrubbing.EnScrubUsingRegex(String s, String regexPattern, Int32 minLength, Int32 maxLength, String invalidCharacterReplacement)
   at EvernoteSDK.ENNote.set_Title(String value)
   at TestEvernote.Program.Main(String[] args) in C:\Users\mark_\documents\visual studio 2017\Projects\TestEvernote\TestEvernote\Program.cs:line 37

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...