string-concatenation Questions

14

Solved

I have been given the two strings "str1" and "str2" and I need to join them into a single string. The result should be something like this: "String1, String 2". The "str1" and "str2" variables howe...
Iodide asked 2/1, 2014 at 11:29

3

I am trying to use templates to create an analogue of the type_info::name() function which emits the const-qualified name. E.g. typeid(bool const).name() is "bool" but I want to see "bool const". S...
Stockist asked 15/8, 2016 at 13:24

31

Solved

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes "Hello World". How is this accomplished in Bash?
Encumbrance asked 15/11, 2010 at 5:38

8

Solved

I would like to know how to concatenate a string to the end of all elements in a list. For example: List1 = [ 1 , 2 , 3 ] string = "a" output = ['1a' , '2a' , '3a']
Chalkboard asked 13/1, 2018 at 18:29

22

I have a dataframe that looks like Year quarter 2000 q2 2001 q3 How do I add a new column by combining these columns to get the following dataframe? Year quarter period 2000 q2 2000q2 2001 q3 2001...
Kasiekask asked 15/10, 2013 at 9:42

15

Solved

I am setting text using setText() by following way. prodNameView.setText("" + name); prodOriginalPriceView.setText("" + String.format(getString(R.string.string_product_rate_with_ruppe_sign), "" +...
Scroop asked 16/10, 2015 at 7:32

11

Solved

Is there a C++ Standard Template Library class that provides efficient string concatenation functionality, similar to C#'s StringBuilder or Java's StringBuffer?
Becerra asked 17/3, 2010 at 14:20

20

Solved

In Go, a string is a primitive type, which means it is read-only, and every manipulation of it will create a new string. So if I want to concatenate strings many times without knowing the length of...
Peyote asked 19/11, 2009 at 3:44

6

Solved

All, I have a large (unavoidable) dynamic SQL query. Due to the number of fields in the selection criteria the string containing the dynamic SQL is growing over 4000 chars. Now, I understand that t...

48

Solved

Consider a database table holding names, with three rows: Peter Paul Mary Is there an easy way to turn this into a single string of Peter, Paul, Mary?
Thirlage asked 11/10, 2008 at 23:49

4

Solved

I've been adding std::string_views to some old code for representing string like config params, as it provides a read only view, which is faster due to no need for copying. However, one cannot conc...
Evangelin asked 24/8, 2022 at 19:4

23

Solved

How do I get: id Name Value 1 A 4 1 B 8 2 C 9 to id Column 1 A:4, B:8 2 C:9

2

Solved

I would like to create a dynamic file path in .bat file. At the moment the file path looks like this: "C:\FolderA\FolderB\FileA.xlsx" I would like to incorporate today's date in the file name to...
Sheep asked 7/4, 2016 at 15:32

13

Solved

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 wit...
Stoat asked 3/1, 2010 at 14:2

2

Solved

I have this code using python 3.11: import timeit code_1 = """ initial_string = '' for i in range(10000): initial_string = initial_string + 'x' + 'y' """ code_2 = &...

7

Solved

Let's say I have a table like this in SQL Server: Id City Province Country 1 Vancouver British Columbia Canada 2 New York null null 3 null Adama null 4 null null France 5 Winnepeg Manitoba null 6 ...
Footling asked 5/7, 2012 at 19:18

2

Please tell me the answer with explanation: #define f(g,h) g##h main(){ printf("%d",f(100,10)); }
Highbinder asked 11/4, 2015 at 12:17

9

Solved

How do I concatenate the following combinations of types: str and str String and str String and String
Narco asked 10/5, 2015 at 17:40

17

Solved

What is the most efficient way to write the old-school: StringBuilder sb = new StringBuilder(); if (strings.Count > 0) { foreach (string s in strings) { sb.Append(s + ", "); } sb.Remove(sb...
Brimmer asked 20/10, 2008 at 8:46

4

Solved

trying to achieve something like tinder's Terms and Conditions, however i cannot figure it out how to make the Terms and Privacy Policy Clickable in swift UI By creating an account or logging in...
Lacerated asked 16/12, 2019 at 15:34

4

Solved

I am working with spark 2.2.0 and pyspark2. I have created a DataFrame df and now trying to add a new column "rowhash" that is the sha2 hash of specific columns in the DataFrame. For example, s...
Snort asked 12/9, 2018 at 9:45

16

Solved

Is this safe to use require("path").join to concatenate URLs, for example: require("path").join("http://example.com", "ok"); //returns 'http://example.com/ok' require("path").join("http://exampl...
Titillate asked 30/4, 2013 at 13:45

4

Solved

Consider the below code. void main() { int num = 5; print('The number is ' + num); } When I try to print the value for the variable num, I get the exception : The argument type 'int' can't be...
Barham asked 16/6, 2018 at 7:14

3

Solved

CREATE OR REPLACE FUNCTION getParentLtree(parent_id bigint, tbl_name varchar) RETURNS ltree AS $BODY$ DECLARE parent_ltree ltree; BEGIN -- This works fine: -- select into parent_ltree l_tree fro...
Hortense asked 26/3, 2014 at 9:33

3

I have a specific series of datasets which come in the following general form: import pandas as pd import random df = pd.DataFrame({'n': random.sample(xrange(1000), 3), 't0':['a', 'b', 'c'], 't1':[...
Waistline asked 19/9, 2016 at 11:14

© 2022 - 2024 — McMap. All rights reserved.