Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to get ServerRelativeUrl from Full Url in CSOM code. In server side code SPWeb.GetServerRelativeUrlFromUrl() method which accepts a full, server-relative or site-relative URL as a parameter and returns the server-relative URL.
Following code will return the ServerRelativeUrl:
Uri uri = new Uri(fullURL);
string serverRelativeURL = uri.AbsolutePath;
Required, but never shown