Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

String concatenation

#create an empty string c
c=""

#read input strings and store them in a and b
read a b

#for loop to append a group of strings to the variable c.  
for val in $a 'ipsum' $b 'sit amet' 10
do
 c+="$val "
done

#The result is a string that consists of all the elements concatenated into a single string
echo "$c"
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #String #concatenation
ADD COMMENT
Topic
Name
6+2 =