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
3 answers

How to move a leading substring to the end of string?

How can I cut part of string before some word put on the end of the same string? For example: $data = '1.jpg,2.jpg,3.jpg,4.jpg,5.jpg,6.jpg,7.jpg,'; I want to put all before 4.jpg, at the end of string like this: $data =…
Mateusz Ji
  • 59
  • 2
  • 8
0
votes
1 answer

PSQL: string concatenation and output string

I am new to psql. I have a table 'pets' as below. name | species | owner | gender | color -------------+---------+--------------------+--------+--------------- Nagini | snake | Lord Voldemort | female | green …
Meruemu
  • 611
  • 1
  • 8
  • 28
0
votes
4 answers

How to replace "-" with empty space when columns are null in LINQ

Here I am having below Linq query which has employee duration column. How can I remove "-" when StartDate or EndDate is null. I want "-" only when both are not null. var query = from r in db.Employee select new { …
user1030181
  • 1,995
  • 5
  • 26
  • 56
0
votes
0 answers

Error ORA-01722: Invalid use of Number in Select with Xmlagg / Xmlelement

I am getting the above error for the following query - only after it runs already for about 30 min. Since I only get the error after this time I was wondering if it is caused by something towards the end of the query, e.g. the ** .EXTRACT **? I…
Mike
  • 155
  • 3
  • 14
0
votes
1 answer

concate or segregate strings based on requirement

USER_ID COLUMN1 COLUMN2 JOHN 24 CA JOHN 24 LA JOHN 63 CA JOHN 63 LA JOHN 66 CA JOHN 66 LA JOHN 9 AF JOHN…
kumar
  • 15
  • 5
0
votes
0 answers

Char & between two strings while rendering in HTML isn't working

I am trying to concatenate two strings with a & in between them and render it in HTML. Say for example, I want to get: Richard & Mary. I tried "Richard" & Chr(38) & "Mary" in the VBScript. It prints Richard & Mary when I do the MsgBox, but while…
WonderHeart
  • 678
  • 10
  • 28
0
votes
2 answers

Concatenation of multiple Strings in Arraylist which can have any value

My requirement is that I have to write a java method in my class which will accept a List as a parameter. Now I have to concatenate public String encode(List ls){ StringBuffer sb = new StringBuffer(); ListIterator lis…
Debashis
  • 11
  • 1
  • 5
0
votes
1 answer

Concatenate values of field depending on text selection Oracle SQL

I have a table a_x with the columns A and B, column A is in CLOB format, column B number(10): A | B -----------------------------|------- atveroeosipsumloremipsumdolor|…
yPennylane
  • 760
  • 1
  • 9
  • 27
0
votes
1 answer

prefixing string to SQL group by values

I have a basic query that illustrates a more complex example: select country, sum(revenue) from world_tbl group by country This would return results such as Canada | 500 USA | 700 I would like to add a string value of 'cntry_' as a…
runningbirds
  • 6,235
  • 13
  • 55
  • 94
0
votes
4 answers

put space between concatenate strings

I am searching to concatenate two strings (passed by C) putting the result in a third string. I did it but know i want to put a space between the strings but... It'snt possible..! This is the C's part #include #include void…
0
votes
4 answers

Difference between {$_GET['id']} and '".$_GET['id']."'?

Is the any difference between writing {$_GET['id']} and '".$_GET['id']."' in a sql statement? both works the same
Bartek
0
votes
3 answers

Mask string in ViewModel C#

I have a view that pulls a list of everything in the database and it works great. However there is one bit of information that I have to mask, and no matter what I try I can't seem to mask it. I want to mask it with 5 * (no matter how long the…
CheezStix
  • 59
  • 2
  • 15
0
votes
1 answer

Javascript: new Regexp destroys for loop iterator when string is concatenated

I have an object called script. It contains a variable called name that contains a string. There is also an array that contains multiptle script objects, the array is called scripts. Its size is 5. I have a for loop where I want to create a new…
Elias
  • 149
  • 1
  • 9
0
votes
0 answers

String Concatenation performance in SQL Server

I've got a query running against SQL Server 2016. The query is quite complex, because it joins several tables (almost 30 tables) using inner and left joins. The result set contains only 4 rows. I have these cases: In the select list I select only…
Giovanni
  • 39
  • 4
0
votes
1 answer

String aggregate using a variable

Is is okay to use a variable to concatenate a value from several rows ( as an implicit aggregate function )? It seems to work fine on my machine, but I haven't seen it recommended. declare @v_str varchar(4000) = '' select top 5 @v_str = @v_str + ','…