Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 19 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 19
Topic #: 1
[All Terraform Associate Questions]

Which of the following is not a valid string function in Terraform?

  • A. split
  • B. join
  • C. slice
  • D. chomp
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
Reference:
https://www.terraform.io/docs/language/functions/chomp.html

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
testtaker_1885
Highly Voted 2 years ago
answer is c slice not listed in official docs https://www.terraform.io/language/functions
upvoted 27 times
bp339
1 year, 11 months ago
https://www.terraform.io/language/functions/slice
upvoted 3 times
Shane_C
10 months ago
The question asked for a function that is not a string function. Slice is a collection function, all other answers are string functions. Answer is C
upvoted 5 times
...
doumx
1 year, 11 months ago
string function
upvoted 2 times
...
samkobadev
1 year, 2 months ago
so the correct answer is?
upvoted 1 times
Shane_C
10 months ago
Answer is C
upvoted 2 times
...
...
...
...
coco10k
Highly Voted 2 years ago
Selected Answer: C
slice is not in string function list.
upvoted 10 times
...
Venki_dev
Most Recent 1 month ago
Selected Answer: C
slice comes under collective function and not string functions. answer is C
upvoted 1 times
...
samimshaikh
4 months, 1 week ago
Selected Answer: C
slice is collection function and chomp is string function so SLICE is correct answer as not a valid string function "C"
upvoted 1 times
...
MisterR0B0T
6 months ago
chomp is not a valid string function in Terraform. The other three options are all valid string functions: split splits a string into a list of strings, based on a delimiter. join joins a list of strings into a single string, using a separator. slice extracts a substring from a string, starting at a specified position and ending at a specified position or length.
upvoted 1 times
mohamed1999
4 months, 1 week ago
that is not correct : chomp removes newline characters at the end of a string. This can be useful if, for example, the string was read from a file that has a newline character at the end. https://developer.hashicorp.com/terraform/language/functions/chomp
upvoted 1 times
...
...
MisterR0B0T
6 months ago
ANSWER IS D. Chomp is not valid Here are some examples of how to use these string functions in Terraform: # Split a string into a list of strings, based on a comma delimiter variable "tags" { type = string } output "tags_list" { value = split(var.tags, ",") } # Join a list of strings into a single string, using a space separator variable "regions" { type = list(string) } output "regions_string" { value = join(var.regions, " ") } # Extract a substring from a string, starting at position 5 and ending at position 10 variable "hostname" { type = string } output "hostname_suffix" { value = slice(var.hostname, 5, 10) }
upvoted 1 times
mohamed1999
4 months, 1 week ago
that is not correct : chomp removes newline characters at the end of a string. This can be useful if, for example, the string was read from a file that has a newline character at the end. https://developer.hashicorp.com/terraform/language/functions/chomp
upvoted 2 times
...
...
imkhan
6 months, 2 weeks ago
The correct answer is C. Slice function is not listed in the official documentation of terraform string functions https://developer.hashicorp.com/terraform/language/functions slice is a collection function that extracts some consecutive elements from within a list. https://developer.hashicorp.com/terraform/language/functions/slice If you are interested to learn about the Terraform string functions you can visit the following link https://bitsto.cloud/terraform-string-functions/
upvoted 1 times
...
Selvan1978
7 months, 1 week ago
Selected Answer: D
A. split: The split function is used to split a string into a list of substrings based on a specified delimiter. B. join: The join function is used to concatenate a list of strings into a single string with a specified delimiter. C. slice: The slice function is used to extract a range of elements from a list or tuple. D. chomp: The chomp function is not a valid string function in Terraform. It is not part of Terraform's standard function set for working with strings. So, the correct answer is D. chomp.
upvoted 2 times
...
kudakk
8 months, 3 weeks ago
Selected Answer: C
Slice Function is not part of the string function. Others like join, split, chomp are part of it.
upvoted 2 times
...
Jayanth
9 months, 1 week ago
C. slice
upvoted 1 times
...
Busi57
9 months, 2 weeks ago
Selected Answer: D
i hesitate between c and D , i choose D
upvoted 1 times
Venki_dev
1 month ago
slice comes under collective function and not string functions. answer is C
upvoted 1 times
...
...
cdechery
9 months, 3 weeks ago
Slice is not a string function. Why are so many answers here just plain wrong with 99% and sometimes 100% of votes on the correct answer?
upvoted 1 times
...
Shane_C
10 months ago
Selected Answer: C
The question asked for a function that is not a string function. Slice is a collection function, all other answers are string functions. Answer is C
upvoted 1 times
...
EdwardBHall
11 months ago
Why are the correct answers SO bad in this site? Someone is an absolute idiot.
upvoted 4 times
...
babs30
12 months ago
slice is the correct answer, C
upvoted 2 times
...
Mehedidevops
12 months ago
why they put in here wrong ans?
upvoted 3 times
...
FarziWaliMarzi
1 year ago
Selected Answer: C
Slice is a collection function, while chomp is a string function. refer URL https://developer.hashicorp.com/terraform/language/functions
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...