我试图将白色空间从前线和底部挤满。 如3所示,没有三重功能。 任何人都知道如何做到这一点?
I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?
我试图将白色空间从前线和底部挤满。 如3所示,没有三重功能。 任何人都知道如何做到这一点?
http://livedocs.adobe.com/flex/3/langref/mx/utils/StringUtil.html#trim%2829”rel=“nofollow noreferer”http://livedocs.adobe.com/flex/3/langref/mx/utils/StringUtil.html#trim%2829
str = str.replace(/^s+|s+$/g, );
Did you check Adobe s Documentation ? http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/String.html
package {
import flash.display.Sprite;
public class StringExample extends Sprite {
public function StringExample() {
var companyStr:String = new String(" Company X");
var productStr:String = "Product Z Basic ";
var emptyStr:String = " ";
var strHelper:StringHelper = new StringHelper();
var companyProductStr:String = companyStr + emptyStr + productStr;
trace(" " + companyProductStr + " "); // Company X Product Z Basic
companyProductStr = strHelper.replace(companyProductStr, "Basic", "Professional");
trace(" " + companyProductStr + " "); // Company X Product Z Professional
companyProductStr = strHelper.trim(companyProductStr, emptyStr);
trace(" " + companyProductStr + " "); // Company X Product Z Professional
iii
iii
iii
StringHelper 页: 1
public function StringHelper() {
iii
public function replace(str:String, oldSubStr:String, newSubStr:String):String {
return str.split(oldSubStr).join(newSubStr);
iii
public function trim(str:String, char:String):String {
return trimBack(trimFront(str, char), char);
iii
public function trimFront(str:String, char:String):String {
char = stringToCharacter(char);
if (str.charAt(0) == char) {
str = trimFront(str.substring(1), char);
iii
return str;
iii
public function trimBack(str:String, char:String):String {
char = stringToCharacter(char);
if (str.charAt(str.length - 1) == char) {
str = trimBack(str.substring(0, str.length - 1), char);
iii
return str;
iii
public function stringToCharacter(str:String):String {
if (str.length == 1) {
return str;
iii
return str.slice(0, 1);
iii
iii
UPDATE : Oh Just see ItzWarty . - ——
http://jeffchannell.com/Action/ 2008/3/as3-trim.html
function trim( s:String ):String
{
return s.replace( /^([s| |
]+)?(.*)([s| |
]+)?$/gm, "$2" );
}
http://www. Designscripting.com/2008/11/string-utils-in-as3/。 拥有一个固定用途功能的吨位,包括舱位
引言
str = StringUtil.trim(str);
你们应该能够使用reg,例如:
var pattern:RegExp = /( |
|s{2,})/g;
trimmedString = untrimmedString.replace(pattern, );
《战争》的解决方案并没有拆除拖车空间。
Amargosh的解决方案对我来说是完美无缺的,还见。
幸运的是,我没有足够的声誉来投票解决阿马戈什问题。
此外,我不得不在这里删除两句:
function trim( s:String ):String
{
return s.replace(/^[s|"]+|[s|"]+$/gs, );
}
I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?
How can I delete the element with a certain index in a Flex XMLList?
I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...
I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...
I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...
When I make a new Flex application in Flex 4 beta 2 (Flash Builder), then it creates a border around the outside of the Panel in this example of a thick width. It places a border with a shadow on the ...
I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...
I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...