Skip to content

Instantly share code, notes, and snippets.

@o2platform
Created February 10, 2012 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save o2platform/1791199 to your computer and use it in GitHub Desktop.
Save o2platform/1791199 to your computer and use it in GitHub Desktop.
hacked way to get a string inside two
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