Left_pad and right_pad in freemarker

Source: Internet
Author: User

Left_pad and right_pad in freemarker


1. Simple Description

(1) left_pad left

(2) The right side of the right_pad

(3) when there is only one parameter, blank is inserted; when there are two parameters, the second parameter symbol is inserted; if the length of the second parameter is greater than 1, this symbol is periodically inserted.


2. Examples

<# -- Left_pad in freemarker is left-side --> [$ {""? Left_pad (8)}] [$ {"E "? Left_pad (8)}] [$ {"EF "? Left_pad (8)}] [$ {"EFG "? Left_pad (8)}] [$ {"EFGH "? Left_pad (8)}] [$ {"EFGHI "? Left_pad (8)}] [$ {"EFGHIJ "? Left_pad (8)}] [$ {"EFGHIJK "? Left_pad (8)}] [$ {"EFGHIJKL "? Left_pad (8)}] [$ {""? Left_pad (8, "*")}] [$ {"E "? Left_pad (8, "*")}] [$ {"EF "? Left_pad (8, "*")}] [$ {"EFG "? Left_pad (8, "*")}] [$ {"EFGH "? Left_pad (8, "*")}] [$ {"EFGHI "? Left_pad (8, "*")}] [$ {"EFGHIJ "? Left_pad (8, "*")}] [$ {"EFGHIJK "? Left_pad (8, "*")}] [$ {"EFGHIJKL "? Left_pad (8, "*")}] [$ {""? Left_pad (8 ,"? *? ")}] [$ {" E "? Left_pad (8 ,"? *? ")}] [$ {" EF "? Left_pad (8 ,"? *? ")}] [$ {" EFG "? Left_pad (8 ,"? *? ")}] [$ {" EFGH "? Left_pad (8 ,"? *? ")}] [$ {" EFGHI "? Left_pad (8 ,"? *? ")}] [$ {" EFGHIJ "? Left_pad (8 ,"? *? ")}] [$ {" EFGHIJK "? Left_pad (8 ,"? *? ")}] [$ {" EFGHIJKL "? Left_pad (8 ,"? *? ")}] <# -- The right side of right_pad in freemarker --> [$ {""? Right_pad (8)}] [$ {"E "? Right_pad (8)}] [$ {"EF "? Right_pad (8)}] [$ {"EFG "? Right_pad (8)}] [$ {"EFGH "? Right_pad (8)}] [$ {"EFGHI "? Right_pad (8)}] [$ {"EFGHIJ "? Right_pad (8)}] [$ {"EFGHIJK "? Right_pad (8)}] [$ {"EFGHIJKL "? Right_pad (8)}] [$ {""? Right_pad (8, "*")}] [$ {"E "? Right_pad (8, "*")}] [$ {"EF "? Right_pad (8, "*")}] [$ {"EFG "? Right_pad (8, "*")}] [$ {"EFGH "? Right_pad (8, "*")}] [$ {"EFGHI "? Right_pad (8, "*")}] [$ {"EFGHIJ "? Right_pad (8, "*")}] [$ {"EFGHIJK "? Right_pad (8, "*")}] [$ {"EFGHIJKL "? Right_pad (8, "*")}] [$ {""? Right_pad (8 ,"? *? ")}] [$ {" E "? Right_pad (8 ,"? *? ")}] [$ {" EF "? Right_pad (8 ,"? *? ")}] [$ {" EFG "? Right_pad (8 ,"? *? ")}] [$ {" EFGH "? Right_pad (8 ,"? *? ")}] [$ {" EFGHI "? Right_pad (8 ,"? *? ")}] [$ {" EFGHIJ "? Right_pad (8 ,"? *? ")}] [$ {" EFGHIJK "? Right_pad (8 ,"? *? ")}] [$ {" EFGHIJKL "? Right_pad (8 ,"? *? ")}]

3. Sample Results

     [        ]     [       E]     [      EF]     [     EFG]     [    EFGH]     [   EFGHI]     [  EFGHIJ]     [ EFGHIJK]     [EFGHIJKL]          [********]     [*******E]     [******EF]     [*****EFG]     [****EFGH]     [***EFGHI]     [**EFGHIJ]     [*EFGHIJK]     [EFGHIJKL]          [?*??*??*]     [?*??*??E]     [?*??*?EF]     [?*??*EFG]     [?*??EFGH]     [?*?EFGHI]     [?*EFGHIJ]     [?EFGHIJK]     [EFGHIJKL]          [        ]     [E       ]     [EF      ]     [EFG     ]     [EFGH    ]     [EFGHI   ]     [EFGHIJ  ]     [EFGHIJK ]     [EFGHIJKL]          [********]     [E*******]     [EF******]     [EFG*****]     [EFGH****]     [EFGHI***]     [EFGHIJ**]     [EFGHIJK*]     [EFGHIJKL]          [?*??*??*]     [E*??*??*]     [EF??*??*]     [EFG?*??*]     [EFGH*??*]     [EFGHI??*]     [EFGHIJ?*]     [EFGHIJK*]     [EFGHIJKL]


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.