Click here to Skip to main content
15,867,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
baseURL=baseURl.replace(http:,"http ://");

What I have tried:

var TotLength: Number= URL.length;
var LastSlashIndex :Number= URL.lastIndexOf("/");
var arr:Array =URL.split("/");
var baseURL:String;
var i:int;
for(i=0 ;i<3;i++){
baseURL+= arr[i];
baseURL= baseURL.replace(null,"");
}

baseURL=baseURl.replace(http:,"http ://");

} var TotLength: Number= URL.length;
var LastSlashIndex :Number= URL.lastIndexOf("/");
var arr:Array =URL.split("/");
var baseURL:String;
var i:int;
for(i=0 ;i<3;i++){
baseURL+= arr[i];
baseURL= baseURL.replace(null,"");
}

baseURL=baseURl.replace(http:,"http ://");

}
Posted
Updated 23-Jun-16 20:51pm

1 solution

I don't know flex, but...baseURL is a string, so shouldn't both the replace parameters be strings as well:
C#
baseURL=baseURl.replace("http:","http ://");
Without string delimiters, it's a regex so it would need '/' delimiters, according to a quick Google: String Replace Function in Flex ActionScript | Shafiul Azam&#039;s Weblog[^]
String - Adobe ActionScript&reg; 3 (AS3 ) API Reference[^]
 
Share this answer
 
Comments
Member 11527624 24-Jun-16 3:17am    
Will look into it ...Thanks for the references :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900