cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

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

How to obtain all parts of a string except for the last segment?

How can I get all parts of a string except for the last segment? For example, given "This is a sentence," using -1 can get the last word "sentence." Using [1 3] can get "This is a," but since the string's length varies each time, the positions are not fixed. Is there a way to directly get all parts of the string except for the last segment?
Names Default To Here( 1 );
Word( -1, "This is a sentence" );
Word( [1 3], "This is a sentence" );
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to obtain all parts of a string except for the last segment?

Negative indexing

Word([1 -2], "This is a sentence");
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to obtain all parts of a string except for the last segment?

Negative indexing

Word([1 -2], "This is a sentence");
-Jarmo

Recommended Articles