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
1 answer

Concatenate line feeds

I am trying to concatenate three string variables. Data X ; a = "A" ; b = "B" ; c = "C" ; z = catx ( '0D0A'x, a, b, c ) ; run; I am trying to display the string values like this in the final dataset, so that the values appear one…
Nimit_ZZ
  • 495
  • 4
  • 10
  • 21
0
votes
0 answers

A list of denied words, with a condition only if glued with symbols

A list of denied words, with a condition only if glued with symbols //my arrays $Rejected_symbols = array('*','#','-','!','?','+','=','¨','^','~','@'); $Rejected_if_with_symbols = array('t1','t2','t3','t4'); my search 1 - symbols always…
Iori Sanch
  • 25
  • 7
0
votes
2 answers

CONCAT last number in column in a string

I'm trying to create a CONCAT() that gets the last number in the exp_id column, then adds the filename to display as a separate column. The column would display the following. copy \\\resfs\reo\reoexps\87\5\7040445i.pdf C:\temp\images CONCAT('copy…
0
votes
1 answer

How do I concatenate strings in NETBEANS with + signs and escape codes?

Here's what I'm trying to do: String output = "If you borrow" + currencyFormatter.format(loanAmount); +" at an interest rate of" + rate + %; +"\nfor" + years; +",you will pay" + totalInterest + "in interest.";
0
votes
2 answers

String concatenation in Python list (of strings) vs. numpy array (of strings)

For the purpose of my application, I can declare an array of strings in two ways: As a list strArr1 = [""] * 5 or As a numpy array strArr2 = numpy.empty([5], dtype=str) However, I see the following difference when I try to concatenate characters…
N. CHATURV3DI
  • 253
  • 1
  • 12
0
votes
1 answer

Java lambda expression: How to concatenate key and set of values from a hashmap?

I am new to lambda expressions and currently I am stuck with a task I'd like to solve (just for the sake of learning lambdas). Given is a map Map> and I want to iterate over the entry sets concatenating the keys and their values…
0
votes
1 answer

Java concatenation not working

This code should get the absolute path, append a string from a preferences file and then append ".json" to match the necessary file. I tried using "+" to concatenate strings, but it was giving the same output as the StringBuilder.append() …
Mateus Terra
  • 159
  • 1
  • 9
0
votes
1 answer

concatenate import url in typescript

I'm developing a software using typescript 2.0.3 and tslint 4.0.2 and angular. I have an issue since my import url is too long for tslint standard. Changing line limit in tslint is not possible in my case. I tried separate the url to pieces and…
Daniel W
  • 1,092
  • 1
  • 12
  • 25
0
votes
0 answers

Mixing String + operator with StringBuilder

Let's say I have the following code: String RET = System.getProperty("line.separator"); int x = 5, y = 3; StringBuilder sb = new StringBuilder(); sb.append("Ship located at " + x + ", " + y + RET); sb.append("Current time: " +…
piegames
  • 975
  • 12
  • 31
0
votes
1 answer

Jess-Rule : Str-Cat in Field comparison doen't compile

I wan't to match a value (String) of an jess-object and the comparative value is a combination of a string and another field. Here a simple ("runnable") example: (defclass Person (is-a :THING) (slot name (type string)) (slot email (type string)))…
0
votes
2 answers

Unable to open .csv file in R ,whose file name is obtained by concatenating a string with a variable

airprobread <- function(id) { fi <- list() for (i in id) { if(i < 10) { fi[[i]] <- read.csv(file = paste("00",i,".csv",sep="")) } else if((i >= 10) & (i < 100)) { fi[[i]] <- read.csv(file=paste("0",i,".csv",sep="")) …
0
votes
0 answers

Concatenate variables in R

I want to create an object in R, which will contain one string, with a few variables (in my case it is file path). When I try to use paste to concatenate the file paths I can see only one last variable instead of all variables in one string. I use…
Tor
  • 1
  • 2
0
votes
2 answers

String concatenation and class function in PHP?

I was writing a simple class. Here is the code: class Book{ var $title; var $publishedDate; function Book($title, $publishedDate){ $this->title = $title; $this->publishedDate = $publishedDate; } function…
progamer
  • 69
  • 6
0
votes
2 answers

shell: strange string concatenation behavior

I write a scipt like this: #!/bin/bash while read line do echo line ${line} pdbfile=${line}.pdb echo pdbfile ${pdbfile} done < myfile The result is: line pdb8mhtA .pdbfile pdb8mhtA While it is supposed to be line pdb8mhtA pdbfile…
dudu
  • 801
  • 1
  • 10
  • 32
0
votes
3 answers

concat php value with entire quotes in sql query

How to concat this php value with entire quotes in sql query, so that it saves as properly in phpmyadmin database? $db = new mysqli('localhost','root','','geo'); // Each value is a placeholder $sql = "UPDATE file_contents SET Origin_URL =…
Unnati
  • 348
  • 5
  • 18