cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • Use JMP Clinical with CDISC-compliant data. Review studies, ID safety and efficacy signals & communicate findings with interactive graphics. Register to see how. Aug. 27, 2 pm US ET.

Discussions

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

Combine many strings into one.

Hi guys,

 

I've a list as per below of string names. I want to concantanate  the value of each string in the list, into one combined string. So the result of below would be a string who's value would be "This is a sentence". 

 

How would I code this ? 

 

Begining = "This";
Middle = "is a";
End = "sentence"
StringList = {"Begining","Middle", "End"};
4 REPLIES 4
txnelson
Super User

Re: Combine many strings into one.

Here is a simple solution

Names Default To Here( 1 );
Begining = "This";
Middle = "is a";
End = "sentence";
StringList = {"Begining", "Middle", "End"};
Sentence = Eval( Parse( StringList[1] ) );
For( i = 2, i <= N Items( stringList ), i++,
	Sentence = Sentence || " " || Eval( Parse( StringList[i] ) )
);
Show( sentence );
Jim

Re: Combine many strings into one.

Select Help > Scripting Index and look up the character string function Concat Items().

txnelson
Super User

Re: Combine many strings into one.

better than my solution....thanks Mark

Jim

Re: Combine many strings into one.

Better? That depends. There are many convenient JSL functions. If their requirements are suitable and their results meet the requirements, then they are better. The general solution that you posted is much more flexible when that counts.

Recommended Articles