string-concatenation

Need a Concatenating VBA code to prevent memory issue workaround

My set up: Have 50,000 rows of data. ( My row count will increase in the future. So might as well say I have a full worksheet of 64000+ rows.) All Data is TEXT, no formulas, etc. Column A is open Columns B thru AC contain the Data that needs to be concatenated The Data in the rows once concatenated to Column A will contain 60,000 di...

String concatenation doesn't seem to work in C#

I don't know what is wrong with the following string: "Report(" + System.DateTime.Now.ToString("dd-MMM-yyyy") + " to " + System.DateTime.Now.AddMonths(-1).ToString("dd-MMM-yyyy") + ")" I can't get the concatenated string. I am getting Report(29-Dec-2009. That's all and the rest gets left out from the string. What is the reason? ...

const char* concatenation

I need to concatenate two const chars like these: const char *one = "Hello "; const char *two = "World"; How might I go about doing that? I am passed these char*s from a third-party library with a C interface so I can't simply use std::string instead. ...

Optimal method to create a large string containing several variables?

I want to create a string that contains many variables: std::string name1 = "Frank"; std::string name2 = "Joe"; std::string name3 = "Nancy"; std::string name4 = "Sherlock"; std::string sentence; sentence = name1 + " and " + name2 + " sat down with " + name3; sentence += " to play cards, while " + name4 + " played the violin."; Thi...

how to chop of a text in a certain length with php?

i wanna get some field values from database and present them on html. but some of them are longer than the div width so i wanted to chop if of and add 3 dots after them if they are longer than lets say 30 characthers. windows vs mac os x-> windows vs m... threads about windows vista -> threads about win... how can i do that? ...

vb.net string concatenation string + function output + string = string + function output and no more

The following output produces a string with no closing xml tag. m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString() + "</G3Grid:Spots>" This following code works correctly m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString() m_rFlight.Layout = m_rFlight.Layout + "</G3...

Efficient string concatenation in C

Here's my problem: I have an array, which contains a command a[1], followed by several command args a[2], a[3], ... What I need to do is the following Create a string, consisting of the cmd and a combination of args E.g.: cmd arg1 arg2 arg3 Execute that command-string Here's how I woud do it (pseudo-code): Precompute the l...

Why join is faster than normal concatenation

Hi, I've seen several examples from different languages that unambiguously prove that joining elements of a list(array) is times faster that just concatenating string. Unfortunately I didn't find an explanation why? Can someone explain the inner algorithm that works under both operations and why is the one faster than another. Here is...

+ operator for String in Java

I saw this question a few minutes ago, and decided to take a look in the java String class to check if there was some overloading for the + operator. I couldn't find anything, but I know I can do this String ab = "ab"; String cd = "cd"; String both = ab + cd; //both = "abcd" Where's that implemented? ...

ruby string concatenation (I think?)

I'm just starting with "The Well-Grounded Rubyist", and they gave the following example: print "Hello. Please enter a Celsius value: " print "The Fahrenheit equivalent is ", gets.to_i * 9 / 5 + 32, ".\n" In particular, I'm looking at line 2, where they seem to be using commas for string concatenation. I assume the + symbol isn't being...

Constructing big strings (e.g. for SQL commands) how smart is the C# compiler?

Hi. This may sound stupid but... When I create big SQL commands I want to keep my code readable and I do this: cmd.CommandText = "SELECT top 10 UserID, UserName " + "FROM Users " + "INNER JOIN SomeOtherTable ON xxxxx " + "WHERE UserID IN (blablabla)"; See the concatenations? Now, to save performance I now do this: cmd.CommandText...

SQL Server 2000: Ideas for performing concatenation aggregation subquery

i have a query that retruns rows that i want, e.g. QuestionID QuestionTitle UpVotes DownVotes ========== ============= ======= ========= 2142075 Win32: Cre... 0 0 2232727 Win32: How... 2 0 1870139 Wondows Ae... 12 0 Now i want to have a column returned that con...

why does a char + another char = a weird number

Here's the code snippet: public static void main (String[]arg) { char ca = 'a' ; char cb = 'b' ; System.out.println (ca + cb) ; } The output is: 195 Why is this the case? I would think that 'a' + 'b' would be either "ab" , "12" , or 3. Whats going on here? ...

Concatenation of fields in different rows

I'm stuck on an aggregation problem that I can't get to the bottom of. I have some data which is best summarized as follows id |phraseId|seqNum|word ========================= 1 |1 |1 |hello 2 |1 |2 |world 3 |2 |1 |black 4 |2 |2 |and 5 |2 |3 |white I'd like a query that gives back...

C++ equivalent of StringBuffer/StringBuilder?

Is there a C++ Standard Template Library class that provides efficient string concatenation functionality, similar to C#'s StringBuilder or Java's StringBuffer? ...

Using string.Format for simple things?

In my early .Net programming days, I used string.Format() only for complex string concatenations, for example to compile strings as Problem with customer order 234 of date 2/2/2002 and payment id 55543. But now I use string.Format for almost every string concatenation I have to do, also simple ones such as prefixing a string with somet...

How to concatenate two unicode characters in DotNet and not have any space?

When I concatenate the following two unicode characters I see both but there is a space between them. Is there anyway to get rid of this space? StringBuilder sb = new StringBuilder(); int characterCode; characterCode = Convert.ToInt32("2758", 16); sb.Append((char)characterCode); characterCode = Convert.ToInt32("25c4", 16); sb.App...

How to quickly generate a new string hash after concatenating 2 strings

If my math is right, I can quickly generate a new hash value for the concatenation of two strings if I already have the individual hash values for each string. But only if the hash function is of the form: hash(n) = k * hash(n-1) + c(n), and h(0) = 0. In this case, hash( concat(s1,s2) ) = k**length(s2) * hash(s1) + hash(s2) eg. h...

How do I concatenate 2 strings in NSIS

How do I concatenate 2 strings in NSIS? ...

How to concatenate int values in java?

hi, I have the following values: int a=1; int b=0; int c=2; int d=2; int e=1; How do i concatenate these values so that i end up with a String that is 10221; please note that multiplying a by 10000, b by 1000.....and e by 1 will not working since b=0 and therefore i will lose it when i add the values up. Thnks you in advance. ...