concatenation

How to concatenate characters in java?

How do you concatenate characters in java? Concatenating strings would only require a + between the strings, but concatenating chars using + will change the value of the char into ascii and hence giving a numerical output. I want to do System.out.println(char1+char2+char3... and create a String word like this. I could do System.out.pr...

SQL character field concatenation (without using CONCAT() or +)

Hey.. I'm trying to concatenate 3 [char(32)] fields:title1title2title3 into one field, but the catch is that I'm using an older version of SQL and it DOES NOT support the CONCAT() subroutine or the + operatorfor example:CONCAT(title1, title2, title3)(title1 + title2 + title3) DON'T WORK!!!!Is there another way? ...

SQL Help: Select statement Concatenate a One to Many relationship

For example I have two tables. The first table is student while the second table are the courses that the a student is taking. How can I use a select statement so that I can see two columns student and courses so that the courses are separated by commas. Thanks. ...

Coalesce vs empty string concatenation

My coworker is new to C# and didn't know about the coalesce operator. So, I saw him write a line of code like this: string foo = "" + str; The idea being that if str is null, this expression would return an empty string. Of course, that could be rewritten as this: string foo = str ?? ""; And I feel that would be more readable. B...

Having problems creating a custom lookup function in excel. Issue with match and concatenated ranges

Hi there, I'm having some trouble with a large spreadsheet of mine. I bring in a lot of raw data into a data sheet, and then do a number of lookups across the data. Using built in functions I've come up with =IF(ISNA(INDEX(Data!$L$7:$L$1100,MATCH(Data!$I$2&$B$199&$B29&Data!$J$5,Data!$K$7:$K$1100&Data!$J$7:$J$1100&Data!$I$7:$I$1100&Data!...

PHP: Is it better to concatenate on 1 line or multiple lines? Or is there a difference?

Is there a difference or is one better than the other of the following: $var = ''; ... $var .= 'blah blah'; $var .= $var2; $var .= 'blah blah'; Or $var = ''; ... $var .= 'blah blah' . $var2 . 'blah blah'; Is there a speed difference or is there a reason why you'd pick one over the other? ...

F# - Breaking a List into Concatenated Strings by an Interval

I have a list of email addresses, and I need to send an email notification to each address. I'd like to do this in blocks of 25 addresses at a time. Is there any quick way in a functional language like F# to "fold" (concatenate) 25 emails addresses together... each separated by a semicolon. I know there is the String.Split method in .NET...

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 ...

How can I combine multiple rows into a comma-delimited list in Oracle?

I have a simple query: select * from countries with the following results: country_name ------------ Albania Andorra Antigua ..... I would like to return the results in one row, so like this: Albania, Andorra, Antigua, ... Of course, I can write a PL/SQL function to do the job (I already did in Oracle 10g), but is there a nicer,...

How can I concatenate a String with a Bit (documentTitle+Archive) SQL server 2005

I get the following error when I try to concatenate Operand type clash: text in incompatible with bit Invalid operator for datatype: Operator equals Add, Type equal bit SELECT F.SubmissionId, F.FormId, F.DocumentTitle + F.Archive AS DocumentTitle, F.Keywords, F.PublishDate, F.PostedDate, F.ExpiredDate, F.IsFlag, F.IsAdminOnly,...

Why does concatenation work differently in these two samples?

I am raising exceptions in two different places in my Python code: holeCards = input("Select a hand to play: ") try: if len(holeCards) != 4: raise ValueError(holeCards + ' does not represent a valid hand.') AND (edited to correct raising code) def __init__(self, card): [...] if self.cardFace == -1 or self.cardSuit ==...

Data Loss in mySQL Using MEDIUMTEXT and pages

Somehow GROUP_CONCAT is able to round up six "pages" of an article (each stored as TEXT) and toss them into a single MEDIUMTEXT without losing any data, but there are some one-page articles that are longer than normal (but still obviously fit within the TEXT data type) that lose a significant amount of data. Anyone know what's up? Origi...

Runtime dependency for std::string concatenation

std::string sAttr(""); sAttr = sAttr+VAL_TAG_OPEN+sVal->c_str()+VAL_TAG_CLOSE; else where in the code I have defined const char VAL_TAG_OPEN[] = "<value>"; sVal is a variable that is retrieved off of a array of string pointers. This works fine in most of the system, windows and linux. However at a customer site, where to my belief...

C# string won't concatenate

// Reads NetworkStream into a byte buffer. NetworkStream ns; System.Net.Sockets.TcpClient client = new TcpClient(); byte[] receiveBytes = new byte[client.ReceiveBufferSize]; ns.Read(receiveBytes, 0, (int)client.ReceiveBufferSize); String returndata = Encoding.UTF8.GetString(receiveBytes); I am successfully reading from a client and s...

Auto-concatenate in Excel

I have a huge (~950 variables) survey response spreadsheet, made 2-4x larger than it needs to be because each item's individual response options are reported in separate columns. E.g., If Question 2 is in cell A1 and has 3 response options, these are listed below the question in cells A2-C2, A3-C3, etc. Note: Only one of A2-C2, etc. is...

Efficient string concatenation in C++

I heard a few people expressing worries about "+" operator in std::string and various workarounds to speed up concatenation. Are any of these really necessary? If so, what is the best way to concatenate strings in C++? ...

Unable to put a .txt -file to the end of another .txt -file

How can I put .Txt file A at the end of .Txt file B in terminal without opening the files? ...

Is there an elegant work around to concatenation?

I am writing a mad libs program for fun and to just program something. The program itself is pretty straight forward, but I find myself resorting to several concatenations due to the nature of the game where you place user given words into a sentence. Is there an elegant work around to resort to less concatenations or even eliminate them...

MySQL Results as comma separated list

I need to run a query like: SELECT p.id, p.name, (SELECT name FROM sites s WHERE s.id = p.site_id) AS site_list FROM publications p But I'd like the sub-select to return a comma separated list, instead of a column of data. Is this even possible, and if so, how? ...

How do I concatenate multiple C++ strings on one line?

C# has a syntax feature where you can concatenate many data types together on 1 line. string s = new String(); s += "Hello world, " + myInt + niceToSeeYouString; s += someChar1 + interestingDecimal + someChar2; What would be the equivalent in C++? As far as I can see, you'd have to do it all on separate lines as it doesn't support mul...