need to get everything after 2nd dash in string?
问题 I have string values like those below: string str1 = "123-456-test"; string str1 = "123 - 456 - test-test"; string str1 = "123-REQ456-test"; string str1 = "123 - REQ456 - test-test"; I need to grab the entire content from string right after the 2nd dash. I tried String.Split('-') , but it did not work. I think I need to use a regex, but I am not able to find a correct one. Please suggest. 回答1: (?:[^-\n]+-){2}(.*)$ You can try this.Grab the capture.See demo. https://regex101.com/r/tS1hW2/21