Created
February 10, 2012 17:45
-
-
Save o2platform/1791199 to your computer and use it in GitHub Desktop.
hacked way to get a string inside two
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _text = "this text happens before<paypal>aaa</paypal>this text happens after"; | |
Func<string, string,string, string> subString_InBetween = | |
(text, before, after) | |
=>{ | |
var splittedText = text.subString_After(before).split(after) ; | |
if (splittedText.size() ==2) | |
return splittedText.first(); | |
return ""; | |
}; | |
return subString_InBetween(_text, "<paypal>","</paypal>"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment