Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 19

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

    Correct Answer: C

    D

    Reference:

    https://www.terraform.io/docs/language/functions/chomp.html

Discussion
testtaker_1885Option: C

answer is c slice not listed in official docs https://www.terraform.io/language/functions

bp339

https://www.terraform.io/language/functions/slice

doumx

string function

samkobadev

so the correct answer is?

Shane_C

Answer is C

Shane_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

coco10kOption: C

slice is not in string function list.

EdwardBHall

Why are the correct answers SO bad in this site? Someone is an absolute idiot.

Mehedidevops

why they put in here wrong ans?

Selvan1978Option: 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.

kudakkOption: C

Slice Function is not part of the string function. Others like join, split, chomp are part of it.

babs30Option: C

slice is the correct answer, C

Molly1994Option: C

answer is C slice. slice is collection function. all other three are string function

Venki_devOption: C

slice comes under collective function and not string functions. answer is C

samimshaikhOption: C

slice is collection function and chomp is string function so SLICE is correct answer as not a valid string function "C"

MisterR0B0TOption: D

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.

mohamed1999

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

MisterR0B0TOption: D

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) }

mohamed1999

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

imkhanOption: C

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/

JayanthOption: C

C. slice

Busi57Option: D

i hesitate between c and D , i choose D

Venki_dev

slice comes under collective function and not string functions. answer is C

cdecheryOption: C

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?

Shane_COption: 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