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

What is the purpose of first parameter in Javascript concat() method?

Consider the following code example demonstrating the usage of concat() method (Taken from W3Schools Javascript Tutorial):

JavaScript String Methods

The concat() method joins two or more…

PHPLover
  • 1
  • 51
  • 158
  • 311
0
votes
1 answer

django format_html not working with string_concat

I am trying to display a two line error message to a user. All attempts I have made have failed and I cannot figure this out, despite searching SO & google. The error I am getting is: Exception Type: IndexError Exception Value: tuple index out of…
user1261774
  • 3,525
  • 10
  • 55
  • 103
0
votes
2 answers

Concat multiple rows PSQL

id | name | Subject | Lectured_Times | Faculty 3258132 | Chris Smith | SATS1364 | 10 | Science 3258132 | Chris Smith | ECTS4605 | 9 | Engineering How would I go…
Darren rogers
  • 627
  • 2
  • 8
  • 17
0
votes
2 answers

Why is my code producing multiple characters?

When opening a file and concatenating the 5th character from each string, I'm getting duplicates of each character in the new string. How can I fix this? def fifthchar(filename): l="" fin=open(filename, "r") for line in fin: …
0
votes
1 answer

REGEXEXTRACT or SPLIT TEXT STRING?

I am trying to create formulae that I've never used before and I'm having an issue. I have the following string as a result of my VLOOKUP: SONIC (325.2 – 3285.1m);DIL (328.6 – 3284.5m);C-ANAL (10.0 – 200.0m);PERF (3169.9 – 3246.1m);COMP (3137.0 –…
0
votes
2 answers

SQL Server Padding 0's with RIGHT Not Working

I am using SQL Server 2008. I have a varchar(30) column which holds check numbers. If the payment was made using a credit card, checknbr will be a zero-length string. I need to pad this data with leading zeroes such that the entire output is ten…
LegalEagle
  • 97
  • 3
  • 15
0
votes
2 answers

Incrementing integer value in form of string in TCL

Hi I have a string variable in tcl that stores some integer value. I need to get the left most digit from the string variable and increment it by 1. Basically below is the code that I wrote to accomplish my task : set maxID 123456; if {$maxID <…
Naphstor
  • 2,356
  • 7
  • 35
  • 53
0
votes
3 answers

How to scan a string in java and then concate it with other string?

The code is not scanning the second string form user. It just prints 'Hello' second string is not printed. package online_questions; import java.util.Scanner; public class Add { public static void main(String[] args) { // TODO Auto-generated…
0
votes
2 answers

Pick values from multiple cells and paste output in one cell

I have a dataset which looks like: A 0.998315185 B 0.232720507 C 0.010558964 D 0.004246209 E 0.002552556 I want to paste below output in one cell as: 0.998315185A+0.232720507B+0.010558964C+0.004246209D+0.002552556E So that I can copy…
ROY
  • 268
  • 2
  • 11
0
votes
1 answer

ConcatRelated Function Returns All Values

Using Allen Browne's ConcatRelated function is not returning correctly. Example: OrderNumber Product Types 00054001021 ROUND 00054001021 WHITE 00054001121 CONCAVE 00054001121 SCORED 00054001121 WHITE 00054001221 CAPSULE 00054001221…
0
votes
3 answers

Its about a syntax in php while inserting data in mysql table

Why is this syntax used: mysql_query("INSERT INTO users (username, password, email, hash) VALUES( '". mysql_escape_string($name) ."', '". mysql_escape_string(md5($password)) ."', '". mysql_escape_string($email) ."', '".…
0
votes
2 answers

Interleave two string arrays

In Java, I have something like this: String[] firstname = { "name1", "name2", "name3" }; String[] lastname = { "lastname1", "lastname2", "lastname3" }; and the result I need would be something like this: String[] newArray = {"name1 lastname1",…
0
votes
0 answers

combining many string variables into 1 in r

I have a data frame with 1000 observations and 200 string variables that are named text.1, text.2, text.3, etc. I would like to create one variable that combines all of the text into one variable (with 1000 observations) named text. As an example, I…
Lily
  • 1
0
votes
0 answers

Use string concatenation in conditional statement in JavaScript

I have written 5 var names. var row1 = "1"; var row2 = "2"; var row3 = "3"; var row4 = "4"; var row5 = "5"; I need to do a condition within every var inside a loop. But I cannot get it to work. Below is the script I used. for (var i = 1; i < 6;…
0
votes
2 answers

How to concatenate in a SQL query to get variable from database?

As a beginner I'm not fan of concatenating but I think this is something that would be really useful for me to know. So I have a while statement that gets data from a table in a database. I'm using a second query below and in between that while…
Sebastian Farham
  • 815
  • 2
  • 13
  • 27