Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2021 Release Wave 1Discover the latest updates and new features to Dynamics 365 planned April 2021 through September 2021.
Release overview guides and videos Release Plan | Preview 2021 Release Wave 1 Timeline
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
I have an ID which I get from the opportunity field. This is ID: (19-20-Opp5-00036), now I want to remove the highlighted part from this Opportunity ID. How to achieve it using C#
Try this one:
string opportunityId = opportunityId.Replace("-Opp5", "");
As Pravin mentioned you can use Replace() method to achieve this.
delete substring in string giving that substring?forum=csharpgeneral
Please mark as verified if this was helpful.
You can use the substring function to get part of the string in c# e.g oppfield.substring(5,5)
syntax - public string Substring(int startIndex, int length)
if it is always going to be formatted as shown and split by - u should write a generic code using split() and then choose the remove the value in the 2nd index. this will work irrespective of the data in the third section and irrespective of the length of the data in other sections.
Business Applications communities