Free2Code
The majority of forums are now only available as archives, which means posting/editing is disabled.

The Anything and Everything forum is still open.
 
Time: 2014-07-23, 09:44am
substring question
Subject: substring question  ·  Posted: 2004-09-22, 06:12pm
Rank: Unregistered
Hello,

Anyone know how I can accomplish the following :

MainForm.field123456 , value as follows : 'H037265 Project Name by C884933 in Location"

I want to assign the Location only to another field. The number of characters varies depending on the Project name and location.

Any ideas?

Thanks,

Shane
 
  Reply to this ·  Post link ·  Top
Subject: Re: substring question  ·  Posted: 2004-09-27, 05:25am
Rank: ? (171)
Member #: 11947
well you can find the spaces around it... i suggest .lastIndexOf(" "; to find the last space, then do that again with the returned value to find the next space and again to find the next..., then do a substring of that. if you know there are always "in location" at the end of the line this'll work fine.

 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.