github.com/kanishk98/terraform@v1.3.0-dev.0.20220917174235-661ca8088a6a/website/docs/language/functions/endswith.mdx (about)

     1  ---
     2  page_title: endswith - Functions - Configuration Language
     3  description: |-
     4    The endswith function takes two values: a string to check and a suffix string. It returns true if the first string ends with that exact suffix.
     5  ---
     6  
     7  # `endswith` Function
     8  
     9  `endswith` takes two values: a string to check and a suffix string. The function returns true if the first string ends with that exact suffix.
    10  
    11  ```hcl
    12  endswith(string, suffix)
    13  ```
    14  
    15  ## Examples
    16  
    17  ```
    18  > endswith("hello world", "world")
    19  true
    20  
    21  > endswith("hello world", "hello")
    22  false
    23  ```
    24  
    25  ## Related Functions
    26  
    27  - [`startswith`](/language/functions/startswith) takes two values: a string to check and a prefix string. The function returns true if the string begins with that exact prefix.