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

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