GetStringBackwards C#

Discussion in 'Code Snippets and Tutorials' started by Belaarx, Dec 19, 2008.

  1. Belaarx

    Belaarx Level I

    Joined:
    Sep 23, 2008
    Messages:
    135
    Likes Received:
    16
    Location:
    San Diego
    I was wondering if anyone had a GetStringBackwards functions in C# that would work like this.

    str1 = "the weather today is chilly bundle up";
    str2 = GetStringBackwards(str1, " bundle up", "today is ");

    str2 would = "chilly"

    I have seen this method before but I can't find it!
     
  2. Zer0

    Zer0 Level IV

    Joined:
    Mar 2, 2008
    Messages:
    3,037
    Likes Received:
    180
    Location:
    Home sweet home
    Why not just GetStringBetween(str1, "today is ", " bundle up")
    ^ GetStringBetween is just some function I made up, I dunno any C# syntax :p
     
  3. Belaarx

    Belaarx Level I

    Joined:
    Sep 23, 2008
    Messages:
    135
    Likes Received:
    16
    Location:
    San Diego
    That was just an example. I think I found a workaround so a mod can close this thread now