Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Getting subStrings from String

Participant ,
Aug 13, 2007 Aug 13, 2007
I am going to receive a string like this
http://localhost:99999/proxy/http://www.mysite.com/videos/myVideo.flv

and I will need to pull out some info such as the port number "99999" and the flv url " http://www.mysite.com/videos/myVideo.flv"

what are my option to get these values from a string?
TOPICS
ActionScript
479
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 13, 2007 Aug 13, 2007
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 13, 2007 Aug 13, 2007
I did look into that before my post but is seems to limited since you have to specify by number of characters. Port number can be 4-5 numbers in length and the flv url will include a random amount of number and letter combos before the filename. Is it possible to flag every thing within forward slashes or any character in that matter.

Example any value between : / this would be the port num .
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 13, 2007 Aug 13, 2007
clbeech you are correct. If I can ensure that the port number remains 5 characters long then the string class will be ideal for this.

working example that was easy to figure out.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 13, 2007 Aug 13, 2007
Another way is to use indexOf to help you with strings of different length. But I'm lazy and often use the corresponding string split and/or array join methods.

e.g.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Aug 14, 2007 Aug 14, 2007
LATEST
great breez, and nice method there GWD.!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines