Results 1 to 8 of 8

Thread: EndsWith

  1. #1
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default EndsWith

    Well since since srl already contains StartsWith(prefix, s: string) i'm suggesting the addition of EndsWith(suffix, s: string);

    Here is the code
    Simba Code:
    function EndsWith(suffix, s: String): boolean;
    begin
      Result := suffix = Copy(s, Length(s)-Length(suffix)+1, Length(suffix));
    end;

    Btw where is the StartsWith located in the include? I couldn't find.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    StartsWith is located in srl/core/simba.simba
    Good work!

  3. #3
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    CTRL + click -> goes to the declaration of the variable/function.

    or

    Search for it in the function list on the left and double click on it.
    Working on: Tithe Farmer

  4. #4
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Very nice.

    And hold up...since when was MasterBB a mod...^^^
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  5. #5
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    CTRL + click -> goes to the declaration of the variable/function.

    or

    Search for it in the function list on the left and double click on it.
    Thanks.

    Quote Originally Posted by Rezozo View Post
    Very nice.

    And hold up...since when was MasterBB a mod...^^^
    ~Rez
    Market mod since today Grazz for that MasterBB.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  6. #6
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Rezozo View Post
    Very nice.

    And hold up...since when was MasterBB a mod...^^^
    ~Rez
    Since the recent scamming I think.

    OT: looks nice, good job!

  7. #7
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    I found this to be slightly faster:
    Simba Code:
    function EndsWith(Suffix, S: string): Boolean;
    begin
      Delete(S, 1, Length(S) - Length(Suffix));
      Result := Suffix = S;
    end;

    But wouldn't really matter unless your using it alot. Nice job

  8. #8
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by Echo_ View Post
    I found this to be slightly faster:
    Simba Code:
    function EndsWith(Suffix, S: string): Boolean;
    begin
      Delete(S, 1, Length(S) - Length(Suffix));
      Result := Suffix = S;
    end;

    But wouldn't really matter unless your using it alot. Nice job
    Cool. That changes the String S but only inside the function EndsWith because the parameter S is not a var?
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •