concatenation

Concatenating record values in database (MS Access) or in server side code (ASP.NET)

大城市里の小女人 提交于 2019-12-11 00:16:48
问题 sorry to bother you people again. I've searched all over the internet but I can't find the solution to my problem. I have two tables in Access and the output is like this: MATH 5 ENGLISH 3 ENGLISH 2 PHYSICS 5 MATH 1 MATH 3 I want it to be: MATH 5, 1, 3 ENGLISH 3, 2 PHYSICS 5 How can I accomplish this? It tried playing with SQL commands in Access database but nothing works. I also looked for solution using the GridView in ASP.NET but no luck either. Is there a way to acomplish this or should I

Combine multiple columns, excluding null values

此生再无相见时 提交于 2019-12-11 00:03:25
问题 I'm trying to figure out how to combine multiple columns, excluding NA values. Input dataframe: data <- data.frame( id = c(1:3), Item1 = c("Egg", "", ""), Item2 = c("Chicken", "Flour", ""), Item3 = c("", "", "Bread"), Item4 = c("", "Milk", "") ) Desired dataframe: desired <- data.frame( id = c(1:3), Item1 = c("Egg", "", ""), Item2 = c("Chicken", "Flour", ""), Item3 = c("", "", "Bread"), Item4 = c("", "Milk", ""), Combine = c("Egg, Chicken", "Flour, Milk", "Bread") ) I have tried combining the

Concatenated white space does not display in result

匆匆过客 提交于 2019-12-10 23:02:50
问题 The padding I want is not properly concatenating, i.e. the white spaces are not showing up. Not sure why it isn't showing up and have been at it for a couple hours tweaking the code with no solution in sight. var padWord = function(word){ if(endsInPunctuation(word)){ trueLength = (word.length)-1; }else{ trueLength = word.length; } switch(trueLength){ case 1: word = " " + word.fontcolor("red"); break; case 2: word = " " + word.replaceAt(1, word.charAt(1), "red"); break; case 3: word = " " +

Concatenation of Strings in Prolog

放肆的年华 提交于 2019-12-10 22:19:36
问题 I am trying to concatenate 4 strings in Prolog. I am able to concatenate 2 and 3 strings but I can't get it to work with 4. This is what I have so far: join2(String1,String2,Newstring) :- name(String1,L1), name(String2,L2), append(L1,L2,Newlist), name(Newstring,Newlist). join3(String1,String2,String3,Newstring) :- join2(String1,String2,S), join2(S,String3,Newstring). join4(String1,String2,String3,String4,Newstring) :- join3(String1,String2,String3,Newstring), join2(String1,String2,S), join2(S

How to concatenate results in T-SQL into column?

大兔子大兔子 提交于 2019-12-10 20:17:37
问题 I'm working on a query which should give me result like: |--Name--|--Surname--|--Language--|--Date-- | | James | Hetfield | en,gb,fr | 2011-01-01| | Lars | Ulrich | gb,fr,ca | 2011-01-01| but my select gets set of rows like: | James | Hetfield | en | 2011-01-01| | James | Hetfield | gb | 2011-01-01| | James | Hetfield | fr | 2011-01-01| | Lars | Ulrich | gb | 2011-01-01| | Lars | Ulrich | fr | 2011-01-01| | Lars | Ulrich | ca | 2011-01-01| Which best method you recommend to convert sets of

Fitnesse Slim: How to concatenate symbol

不羁的心 提交于 2019-12-10 18:22:17
问题 How would one concatenate a symbol with text on either side? For example: Prefix: "GAR_" Variable: $todayDate Suffix: "_1" GAR_$todayDate_1 Which would evaluate to: GAR_07202012_1 When running the test in fitnesse, it seems as though the concatenation is working ( GAR_$todayDate->[07202012]_1 ). However, I am passing this value as a parameter to visual studio and I instead end up with the following text: GAR_$todayDate_1 . When I remove the suffix or put a space between $todayDate and "_1" ,

Excel - Merge rows with common values and concatenate the differences in one column

為{幸葍}努か 提交于 2019-12-10 16:44:43
问题 I would like to merge rows with common values and concatenate the differences in one column. I think the easiest thing to do is show you an example. Input: Customer Name | NEW YORK | ALBANY Customer Name | NEW YORK | CLINTON Customer Name | NEW YORK | COLUMBIA Customer Name | NEW YORK | DELAWARE Customer Name | NEW YORK | DUTCHESS Customer Name | VERMONT | BENNINGTON Customer Name | VERMONT | CALEDONIA Customer Name | VERMONT | CHITTENDEN Customer Name | VERMONT | ESSEX Customer Name |

Concatenate string literal with another string

被刻印的时光 ゝ 提交于 2019-12-10 16:24:58
问题 Is there some reason why I cannot concatenate a string literal with a string variable? The following code: fn main() { let x = ~"abcd"; io::println("Message: " + x); } gives this error: test2.rs:3:16: 3:31 error: binary operation + cannot be applied to type `&'static str` test2.rs:3 io::println("Message: " + x); ^~~~~~~~~~~~~~~ error: aborting due to previous error I guess this is a pretty basic and very common pattern, and usage of fmt! in such cases only brings unnecessary clutter. 回答1:

javascript How Array.prototype.push concatenates

泪湿孤枕 提交于 2019-12-10 16:12:35
问题 I've seen the Array's push method used to replace concatenation, but I'm not entirely sure how it works. var a = [1,2,3]; var b = [4,5,6]; Array.prototype.push.apply(a,b); How does this concatenate in place rather than returning a new array? 回答1: .apply() takes two arguments: fun.apply(thisArg[, argsArray]) You're passing a as your this object and b as your argument list, so your code is really calling .push() with the elements of b as your arguments: var a = [1, 2, 3]; a.push(4, 5, 6); Now,

Concatenate a vector of vectors of strings

耗尽温柔 提交于 2019-12-10 15:15:16
问题 I'm trying to write a function that receives a vector of vectors of strings and returns all vectors concatenated together, i.e. it returns a vector of strings. The best I could do so far has been the following: fn concat_vecs(vecs: Vec<Vec<String>>) -> Vec<String> { let vals : Vec<&String> = vecs.iter().flat_map(|x| x.into_iter()).collect(); vals.into_iter().map(|v: &String| v.to_owned()).collect() } However, I'm not happy with this result, because it seems I should be able to get Vec<String>