Solved

subString

Posted on 2004-08-10
4
3,574 Views
Last Modified: 2013-12-24
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
Comment
Question by:spunog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
PE_CF_DEV earned 50 total points
ID: 11763456
treat the string as a list and look for listlast() in your example you want to do listlast("Hello and_ Welcome to _America","_")
0
 
LVL 6

Expert Comment

by:PE_CF_DEV
ID: 11763473
oh in addition you would have to add the _ back into the variable if you wanted _America instead of America.

0
 
LVL 35

Expert Comment

by:mrichmon
ID: 11763782
Yep that is the fastest way.
0
 

Author Comment

by:spunog
ID: 11763850
Cool thanks a mil
Spunog
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
What You Need to Know when Searching for a Webhost Provider

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question