Skip to main content

Posts

Regex get string between matching strings

Friends If we want to get exact value between two matching strings. Example :  Statement : Shreeyansh Shlok is a good boy Question : Get value (adjective) between a and boy in above statement a\s(.*)\sboy Output : good Please note, we wanted to catch only the adjective without spaces, so we included \s (regex for matching space) after and before the strings. In case we don't care about space we can use following instead. a(.*)boy Output  : good We can try above or learn more regex here : Regex101 References : Stackoverflow help
Recent posts

Lambda expressions basics

Friends I have always mentioned and maintained that I am a fan of Shiv Prasad Koirala. Learnt so many topics reading his articles and watching his recorded videos.  Following is a gem. It is mostly about 3 Generic Delegates namely Func, Action & Predicate. But as usual he discusses right from start that is Delegates. Its a fun watch. At last even he gives a small glimpse of Expression Trees. A must watch for Beginners and Intermediate programmers. Talk is cheap, so let's jump to 

IEnumerable Vs IEnumerator

Friends This is one of most basic things to understand in .Net Collections (not sure if it is same in Java or other langs). IEnumerable is superclass of all we use Lists, Dictionaries, HashTables and all others.

Difference between Convert.ToString() and .ToString()

Friends Always remember -> whenever we are using Convert. with anything, it can handle nulls without throwing errors.