cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

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