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:

System.ArgumentOutOfRangeException 

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
  HResult=0x80131502
  Message=Index and length must refer to a location within the string.
Parameter name: length
  Source=<Cannot evaluate the exception source>
  StackTrace:
   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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...