F_

<< F_PADRIGHT U_PADRIGHT F_RPADRIGHT | IBExpert UDF Functions | F_LINEWRAP U_LINEWRAP >>

F_PADCENTER U_PADCENTER

 
  • function from adhoc
  • Compatible with UTF-8
  • Input VARCHAR(4095) String 1, filled up with the indications from string 2 to the length of parameter 3, VARCHAR(16) String 2 to fill up with, INTEGER Length of the string, up to which is to be filled up
  • Output VARCHAR(4095) String 1 left and right filled up from the string with the indications from string 2 to the overall length of indications of parameter 3

If the "filled-length" is not eval, there is one more character filled up left

Example

 SELECT 'XXThis is just a TesttXX' AS ISCORRECT, F_PADCENTER('This is just a Test', 'X', 23) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_PADCENTER
 ======================== ===============================================
 XXThis is just a TesttXX XXThis is just a TestXX 

Example

 SELECT 'XXThis is just a TestX' AS ISCORRECT, F_PADCENTER('This is just a Test', 'X', 22) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_PADCENTER
 ====================== ===================================================
 XXThis is just a TestX XXThis is just a TestX

Example

 SELECT 'XxThis is just a TestXx' AS ISCORRECT, F_PADCENTER('This is just a Test', 'Xx', 23) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_PADCENTER
 ======================= ===================================================
 XxThis is just a TestXx XxThis is just a TestXx

Example

 SELECT 'XxThis is just a TestX' AS ISCORRECT, F_PADCENTER('This is just a Test', 'Xx', 22) FROM RDB$DATABASE;

Expected results:

 ISCORRECT                F_PADCENTER
 ====================== ===================================================
 XxThis is just a TestX XxThis is just a TestX

Example

 SELECT NULL AS ISCORRECT, F_PADCENTER(NULL, NULL, NULL) FROM RDB$DATABASE;

Expected results:

  ISCORRECT                F_PADCENTER
 ====================== ===================================================<null>    <null>

back to top of page
<< F_PADRIGHT U_PADRIGHT F_RPADRIGHT | IBExpert UDF Functions | F_LINEWRAP U_LINEWRAP >>