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.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

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

getting a string from a list, where string contains defined text

Hi,

 

can someone help me please? I have created a list that looks something like that:

{"C1234_here_is_some_text", "C1235_here_is_some_other_text", "C1236_you_get_the_idea", ..., "C2000_still_dont_ends_here"}

I want to get the complete string of the list where the first part of the string (e.g. "C1234") is "C1999".

Whats the correct code here?

Thank you in advance

 

1 REPLY 1
txnelson
Super User

Re: getting a string from a list, where string contains defined text

This is how I would do it

Names Default To Here( 1 );
x = {"C1234_here_is_some_text", "C1235_here_is_some_other_text", "C1236_you_get_the_idea", ..., "C2000_still_dont_ends_here"};

found = "Not Found";
For( i = 1, i <= N Items( x ), i++,
	If( Contains( x[i], "C1999" ) == 1,
		found = x[i];
		Break()
	)
);
show(found);
Jim

Recommended Articles