Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for phpPlatonLib/common/str/Attic/fnc.pretty_substr.php between version 1.2 and 1.3

version 1.2, 2002/05/15 00:56:21 version 1.3, 2002/07/24 15:23:08
Line 37  function pretty_substr($string, $length,
Line 37  function pretty_substr($string, $length,
         return $string;          return $string;
 }  }
   
   #
   # Oracle PL/SQL -- the same author
   # warning: code below contains at least one bug
   #
   
   # set define off; -- makes it so SQL*Plus doesn't choke on the '&'
   #
   # create or replace
   # function pretty_substr
   # (
   #     str       in    varchar2,
   #     len       in    number,
   #     slop      in    number default 3
   # )
   # return varchar2 is
   #    result     varchar2(4000);
   #    last_space number;
   # begin
   #    if length(str) > len then
   #       result := substr(str, 0, len - 1);
   #
   #       last_space := instr(result, ' ', (-1 * slop), 1);
   #
   #       if last_space > 0 then
   #          result := substr(result, 0, last_space - 1);
   #       end if;
   #
   #       result := result || '…';
   #    else
   #       result := str;
   #    end if;
   #
   #    return result;
   # end pretty_substr;
   # /
   
 ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top