cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
ENTHU
Level IV

how to add spaces while concatenating data from 2 lists?

I have 3 lists and each list conatins 1 item. I need to concatenate 3 items to get 1 string. But not been able to get spaces between the 3 words of the string.How can I do this?

1 ACCEPTED SOLUTION

Accepted Solutions
ron_horne
Super User (Alumni)

Re: how to add spaces while concatenating data from 2 lists?

Hi @ENTHU 

it would be useful if you gave a bit of context such as a little script of table. otherwise try this:

str1 = "one";
str2 = "two";
str3 = "three";
 
comb = Concat Items({str1, str2, str3}, " ");

Ron

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: how to add spaces while concatenating data from 2 lists?

I am not sure exactly what you are asking for, but the code below, takes 2 lists and adds a blank entry between the concatenation of the two lists.

a={"one","two"};
b={"three","four"};
c=a|| {" "} || b;
Jim
ron_horne
Super User (Alumni)

Re: how to add spaces while concatenating data from 2 lists?

Hi @ENTHU 

it would be useful if you gave a bit of context such as a little script of table. otherwise try this:

str1 = "one";
str2 = "two";
str3 = "three";
 
comb = Concat Items({str1, str2, str3}, " ");

Ron

pmroz
Super User

Re: how to add spaces while concatenating data from 2 lists?

Here's a simple solution:

list1 = {"abc"};
list2 = {"def"};
list3 = {"ghi"};
concat_string = list1[1] || " " || list2[1] || " " || list3[1];
show(concat_string);

Result from the log:

concat_string = "abc def ghi";

Recommended Articles