[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3585
  • Last Modified:

subString

How can I make a substring from the last index of a char to the end of the String.

IF I have the String "Hello and_ Welcome to _America" I want to extract the _America bit into a separate variable, how do I do this?

Basically how do I search for the last index of a char?

Spunog  
0
spunog
Asked:
spunog
  • 2
1 Solution
 
PE_CF_DEVCommented:
treat the string as a list and look for listlast() in your example you want to do listlast("Hello and_ Welcome to _America","_")
0
 
PE_CF_DEVCommented:
oh in addition you would have to add the _ back into the variable if you wanted _America instead of America.

0
 
mrichmonCommented:
Yep that is the fastest way.
0
 
spunogAuthor Commented:
Cool thanks a mil
Spunog
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now