Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. ›
  3. posts
  4. ›
  5. …

  6. ›
  7. CLI

Loading ⏳

Fetching content, this won’t take long…


💡 Did you know? 🐙 Octopuses have three hearts and blue blood.

🍪 This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Cover Image for Terraform CMD Cheatsheet - String Functions

Terraform CMD Cheatsheet - String Functions

Cheatsheet for commonly used Terraform string functions

Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Mon Sep 29 2025

Share This on

func output usage
startswith("hello world", "hello") true
endswith("hello world", "world") true
upper("hello") HELLO
lower("HELLO") hello
strrev("hello") olleh
substr("hello world", 1, 4) ello
title("hello world") Hello World
trim("?!hello?!", "!?") hello Removes the specified set of characters from the start and end of the given string.
trimsuffix("helloworld", "world") hello removes the specified suffix from the end of the given string.
trimprefix("helloworld", "hello") world removes the specified prefix from the start of the given string.
trimspace(" hello\n\n") hello removes any space characters from the start and end of the given string.
indent(2, "[\n foo,\n bar,\n]\n") items: [ foo,bar] adds a given number of spaces to the beginnings of all but the first line in a given multi-line string.
join("-", ["foo", "bar", "baz"]) "foo-bar-baz" produces a string by concatenating all of the elements of the specified list of strings with the specified separator.
replace("1 + 2 + 3", "+", "-") 1 - 2 - 3 searches a given string for another given substring, and replaces each occurrence with a given replacement string.
split(",", "foo,bar,baz") ["foo","bar","baz",] produces a list by dividing a given string at all occurrences of a given separator.
Let's work together
+49 176-2019-2523
hiteshkrsahu@gmail.com
WhatsApp
Skype
Munich 🥨, Germany 🇩🇪, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
  Home/About
  Skills
  Work/Projects
  Lab/Experiments
  Contribution
  Awards
  Art/Sketches
  Thoughts
  Contact
Links
  Sitemap
  Legal Notice
  Privacy Policy
Follow @HiteshSahu_

Made with

NextJS logo

NextJS by

hitesh Sahu

| © 2025 All rights reserved.