Questions tagged [string-concatenation]

String concatenation is the operation of joining two character strings end-to-end.

In particular in the theory of computation, the concatenation operation on strings is generalized to an operation on sets of strings as follows:

For two sets of strings S1 and S2, the concatenation S1S2 consists of all strings of the form vw where v is a string from S1 and w is a string from S2. In this definition, the string vw is the ordinary concatenation of strings v and w as defined in the introductory section. In this context, sets of strings are often referred to as formal languages.

Programming languages often provide operators (such as the + sign) to simplify concatenation of strings. For example, "s1" + "s2" would result in "s1s2".

2012 questions
0
votes
2 answers

Concatenating strings into array list

Hello I am trying to scan the numbers 1-113 and do the following I. If the number is odd, print “x is odd” II. If the number is divisible by 5, print “hi five” III. If the total of a number (x) and its subsequent number (x+1) is a value divisible…
0
votes
1 answer

In java properties file itself can we concatenate two or more than two variables together?

I have gateway.properties file and it has following content: current.path=c:/projects/sdk/ log.path=storage/logs Here, in this file: Either, I want to add third variable which is current.log.path and its value must…
Yeshwant KAKAD
  • 279
  • 1
  • 6
  • 16
0
votes
1 answer

How to write a condition inside a cats() string-concatenation in SAS

Is it possible to write a condition inside a cats() function? Something like this: data ... ... line2=cats('xxxx',if (severity=.) then 'missing' else severity,'yyyyy'); ... I would like to do this in order to write a json file. Because…
stallingOne
  • 3,633
  • 3
  • 41
  • 63
0
votes
2 answers

Update each row of a table with the corresponding value

I have two Postgres tables: create table A( id_A serial not null, column_A varchar null; ...); create table B( id_B serial not null, id_A int4 not null, name varchar null, keywords varchar null, ...); An element…
karim
  • 149
  • 1
  • 3
  • 15
0
votes
0 answers

concation in query YII2 is not working

Well i am new to yii framework i need to execute subquery like below- (select concat(cp.id,'|',campp.prosjektkode,'|',cp.kunder_id) from campaign_company cp left join campaign campp on cp.campaign_id= campaign.id where…
Veshraj Joshi
  • 3,544
  • 3
  • 27
  • 45
0
votes
1 answer

How to concat macros in C

I have a macro that displays the month from __DATE__ as a numeric value string literal: #define MONTH (\ __DATE__[2] == 'n' ? (__DATE__[1] == 'a' ? "01" : "06") \ : __DATE__[2] == 'b' ? "02" \ : __DATE__[2] == 'r' ? (__DATE__[0] == 'M' ? "03" :…
linsek
  • 3,334
  • 9
  • 42
  • 55
0
votes
3 answers

vb.net handling many table name using string

Am storing a table name in a String ugad = "INSERT INTO tb(Ugname,Ugdob,Uggender)" this is the ordinary query which functions well. But i need to store a Tablename in a string called "dept" and this string will have diff table name at diff times.…
Harish
  • 169
  • 3
  • 5
  • 11
0
votes
2 answers

T-SQL Server 2012 QUOTENAME issue with first instance of string

I'm trying to use QUOTENAME to enclose each part of the string returned in brackets but cannot seem to find the solution to enclose the first instance of the string? CREATE TABLE dbo.Products ( ProductID INT PRIMARY KEY, Name …
SSMSJ
  • 219
  • 3
  • 14
0
votes
3 answers

How to concatenate 2 strings using malloc and not the library functions

I need to create a function to concatenate 2 strings, in my case they are already given. I will need to concatenate the strings 'hello' and 'world!' to make it into 'helloworld!'. However, I can't use library functions besides strlen(). I also need…
joeymed
  • 13
  • 1
  • 5
0
votes
0 answers

Concatenate a string to the whole dataframe column

I have a data frame and want to append some text with all the elements of it. For example My Data frame 1 2 3 4 I want the resulting data frame as number 1 number 2 number 3 number 4 So the "number" string is in common which I have to append…
priyanka3
  • 149
  • 1
  • 3
  • 13
0
votes
0 answers

Concatenate and Justify in Excel

I have the data below: I would like to locate the maximum length of the string of texts in the first column, and from there count the number of spaces to position the second concatenated item to align. My attempt to concatenate has the below…
0
votes
1 answer

Concatenate string using .format

I have some code similar to the following: test_1 = 'bob' test_2 = 'jeff' test_1 += "-" + test_2 + "\n" Output: bob- jeff\n I'd like to have the same functionality but using the .format method. This is what I have so far: test_1 = "{}{}…
0
votes
3 answers

Additive Operator (+) Performing Concatenation Instead of Addition

I am new to Java. When I am processing through the loop below I want to show the loop's counter value being incremented by 1. When I kept the below code of that I am getting the value as like of concatenate with 1 with the counter value. Why is the…
Parthasarathy
  • 308
  • 2
  • 10
0
votes
1 answer

How to declare a variable with no value?

The following code is what I am using to convert a hex to binary. To print binary out, I add individual strings to a previously declared blank variable. However, this prints out "undefined + binary". Is there a way to declare a variable with no…
John the User
  • 620
  • 2
  • 5
  • 13
0
votes
1 answer

Strange C++ string concatenation behaviour

I've been noticing this strange behaviour with string concatenation despite the fact that strcmp returns zero, showing both forms are identical The include file options.h is as follows struct options = { std::string ctifile; ... }; The main…
gpavanb
  • 288
  • 2
  • 12
1 2 3
99
100