Strings(I): Concatenation

Ace your homework & exams now with Quizwiz!

Write an expression whose value is the concatenation of the three str values associated with name1, name2, and name3, separated by commas. So if name1, name2, and name3, were (respectively) "Neville", "Dean", and "Seamus", your expression's value would be "Neville,Dean,Seamus".

name1+','+name2+','+name3

Write an expression that is the concatenation of the str associated with s1 and that associated with the str s2.

s1 + s2

Given a variable word that has been assigned a string value, write a string expression that parenthesizes the value of word. So, if word contains "sadly", the value of the expression would be the string "(sadly)"

"(" + word + ")"

Write an expression that is the concatenation of the strings "Hello" and "World".

"Hello" + "World"

Given a String variable address, write a String expression consisting of the string "http://" concatenated with the variable's String value. So, if the variable refers to "www.turingscraft.com", the value of the expression would be "http://www.turingscraft.com".

'http://' + address

Write an expression that concatenates the String variable suffix onto the end of the String variable prefix .

(prefix) + (suffix)


Related study sets

Unit 7: Agency Module 12: Agency Relationships Quiz

View Set

Ideas that Shaped Darwin's Thinking 16.2

View Set

Cloud Computing: Chapter 1 Introduction

View Set

Chapter 31: The Americas in the Age of Independence

View Set

french: indirect object pronouns

View Set

Human Resource Management Test #2

View Set