REPLACING CHARACTER STARTING FROM THE RIGHT.

Hey everyone,
The built-in function replace() replaces a character "." starting from left by default.
var txt:String = "2.5.";
if (txt.indexOf(".") == 1) // using (txt.lastIndexOf(".") == 1) does nothing.
     txt = txt.replace(".","");
     trace(txt); // 25.
There must be a simple method to replace "." starting from the right so that the traced output is "2.5".

"A built-in function would be preferable rather than those RegExp but it works."
I disagree.
One always can build a function. RegExp do wonders - so why overwhelm library with redundant functionality in the main library, especially as far as the top level objects like String are concerned?

Similar Messages

  • How to change direction of a spreadsheet to start from the right side?

    default spreadsheet direction on numbers is left to right. would it be possiable to change it into right to left direction instead?

    Mbahaie wrote:
    I am not interested in installing MS products on my MacBook!!!
    MS products for Mac do not do what you want.  OpenOffice is NOT an MS product.  Try it.
    To ask for new features from Apple, you can go to
    http://www.apple.com/feedback

  • Script needed to generate a list of paragraph and character styles from the Book Level

    Hello,
    I am using FrameMaker 11 in the Adobe Technical Communication Suite 4 and I need to find a script that will generate a list
    of paragraph and character styles from the book level.
    I am working with unstructured FrameMaker books, but will soon be looking at getting a conversion table developed
    that will allow me to migrate all my data over to Dita (1.1 for now).
    Any thoughts, ideas on this is very much appreciated.
    Regards,
    Jim

    Hi Jim,
    I think the problem you are having with getting a response is that you are asking someone to write a script for you. Normally, you would have to pay someone for this, as it is something that folks do for a living.
    Nonetheless, I had a few minutes to spare, so I worked up the following script that I believe does the job. It is very slow, clunky, and totally non-elegant, but I think it works. It leverages the book error log mechanism which is built in and accessible by scripts, but is spendidly unattractive. I hope this gives you a starting point. It could be made much more beautiful, of course, but such would take lots more time.
    Russ
    ListAllFormatsInBook()
    function ListAllFormatsInBook()
        var doc, path, fmt;
        var book = app.ActiveBook;
        if(!book.ObjectValid()) book = app.FirstOpenBook;
        if(!book.ObjectValid())
            alert("No book window is active. Cannot continue.");
            return;
        CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
        CallErrorLog(book, 0, 0, "** Book format report for:");
        CallErrorLog(book, 0, 0, book.Name);
        var comp = book.FirstComponentInBook;
        while(comp.ObjectValid())
            path = comp.Name;
            doc = SimpleOpen (path, false);
            if(doc.ObjectValid())
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, doc, 0, "");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Paragraph formats:");
                fmt = doc.FirstPgfFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextPgfFmtInDoc;
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "Character formats:");
                fmt = doc.FirstCharFmtInDoc;
                while(fmt.ObjectValid())
                    CallErrorLog(book, 0, 0, "  - " + fmt.Name);
                    fmt = fmt.NextCharFmtInDoc;
            else
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
                CallErrorLog(book, 0, 0, "!!!  Could not open: " + comp.Name + " !!!");
                CallErrorLog(book, 0, 0, "-----------------------------------------------------------");
            comp = comp.NextComponentInBook;
    function CallErrorLog(book, doc, object, text)
        var arg;
        arg = "log ";
        if(book == null || book == 0 || !book.ObjectValid())
            arg += "-b=0 ";
        else arg += "-b=" + book.id + " ";
        if(doc == null || doc == 0 || !doc.ObjectValid())
            arg += "-d=0 ";
        else arg += "-d=" + doc.id + " ";
        if(object == null || object == 0 || !object.ObjectValid())
            arg += "-O=0 ";
        else arg += "-O=" + object.id + " ";
        arg += "--" + text;
        CallClient("BookErrorLog", arg);

  • Why can't I remove the long BOOKMARKS button from the right hand end of the bookmarks toolbar?

    This button is completely superfluous and takes up space on my Bookmarks Toolbar. How do I remove it please?
    To be clear, I have the 'normal' bookmarks button on my main toolbar that opens up my bookmarks in the panel on the left. What is the purpose of the Bookmarks button on the right end of the bookmarks toolbar that opens up the same bookmarks in a different presentation, and how do I get rid of it?

    Thanks very much Vivek and the-edmeister, now I understand and have managed to remove the unwanted button. I beieve the ergonomics of all this are very poor - starting from the fact that 'customize' gives the impression you are in control of what appears and what doesn't, but this is confused by the fact that Firefox is also adding and removing icons depending on what toolbars are showing. Also, and the main cause for this problem, the icon I want to remove from Bookmarks toolbar does not show on Bookmarks toolbar in 'Customize' view. AND, there's the fact that the icon doesn't even look the same in the two views so it's not obvious that moving the little button (in customize) will affect the larger button with text that's on another toolbar!
    For other people with the same problem, my re-writing of Vivek's original solution so it works on my system is this:
    Please try this: right-click on the '''+''' after the last tab and '''Customize''' and click, hold and drag the star icon that has the little down arrow beside it from any of the toolbars on which it appears (it probably <b>won't</b> be in the Bookmarks toolbar!) into the Customize mini window.
    Thanks again both.

  • Of clans but due to shortage of space i want to delete it for some days.If i delete the app and then reinstall it after a month should i start from the beginning or cont. from where i left

    i use ipad mini with retina display 16gb i love playing clash of clans but due to shortage of space i want to delete it for some days.If i delete the app and then reinstall it after a month should i start from the beginning or cont. from where i left

    However, I originally had the kindle app on there and when he is reinstalling it comes up with my kindle account. How do we change this?
    OPen teh Kindle app.
    Tap the i at bottom right then Settings > Deregister this device.
    -> http://www.amazon.com/gp/help/customer/display.html?nodeId=200375710&#managedevi ces
    He does not have an actual kindle so I am not sure if he would be able to create one anyways.
    The Kindle app is so you do not have to use a Kindle. Yes, he can have a Kindle account and not own an actual Kindle hardware device.

  • How do I restart iOS download after internet crashes without having to start from the beginning.

    My internet crashes and stops downloading the iOS restore software for my phone.  When I try to restart the download, it starts from the beginning.  How can I get it to cary on from where it left off?  Why doesn't it do this automatically!?
    Thanks.

    If you've already unsuccessfully tried to resume the download then the previously partial download may no longer be present on you computer.<br />
    What you can do in such a case is:
    * Move the old .part partial download and the 0 byte final file without the .part to another location.<br />
    * Start a new download and pause it, don't close Firefox.<br />
    * Copy the two files (.part and 0 byte final) that you moved above back to the download location to replace the new files that were created.<br />
    * Resume the download in Firefox.

  • Depreciation for additions to start from the following month

    Hi Gurus,
    Have situation in depreciation posting, When acquisition happens depreciation has to start from next period on wards (Dep not to post in Acq period) this is working fine and good. (period control maintained as 11 for Acq)
    In the same way it has to apply for Additions if any happens for existing Acquisitions. Period control set as next month 11 for additions, but system making the posting in acquisition period itself including catchup of previous periods from oredinary dep starting.
    I want make the system to start depreciating dep from the following period rather than acquisition period for Additions and catcup dep also post in this from Ordinary depreciation start date .
    Example of Issue:
    Acquisitions:
    Acquisition happend in Period-01, dep started from next period "02"
    This working fine.
    Addiotions:
    Using the above example
    Addition happend in period-05, Dep started from-05 including the catch up dep of periods; 02,03,04,05.
    By right the depreciation posting has to starts in the following Perios 06, has to consider Catchup amounts also.
    Any help on the above are appreciated most.
    Points are available
    Thanks in advance,
    Vyas

    Hi Milosavljevic,
    On the above system behaviour is right, but we have to understand like below:
    What ever posted the Depreciation amount in the acquissition month it belongs to accumilation depreciation of the addition of asset ( from ordinary dep start date to untill acquissition period).These happend bcoz of catchup, the real depreciation was started from the following month onwards..
    Hope this understanding made me clear...
    If u able to find any thing better pla keep share..
    Others plz comment on this for better understanding.
    Thanks,
    Vyas

  • Why does my text in Indesign start on the right side instead of the left?

    I have done something to the newsletter that I am working on, but I don't know what I did.
    Whenever I try to write a caption on a picture or try to type a piece of text for the newsletter, the cursor starts on the right side instead of the left and makes weird spacing and never lines up correctly.
    The only way I can get text to work now is to use a snipping tool and snip text from another program!

    With just the text tool selected, but no text boxes selected (or made), any change to the style of paragraphs or fonts etc is 'set' for the document. If you have clicked on the right alignment tool with nothing selected, then everything from then onwards will default to right align.
    If every document you've worked on is doing this, then open InDesign with no document open (so just the panels showing, but no file/doc open) and select left align with the text tool in use. Any setting made with InDesign like this, is default for any new document created. Colours, alignment, optical kerning, fonts, sizes, leading etc etc changed in this state, is the new default.

  • How can I make my movies always start from the beginning?

    I want to use my iPod to present short videos as part of a live presentation. I've conquered the hurdles, and have the iPod sending video out to my projector, but I want to ensure that every movie starts at the beginning, even if I had cut it short in the last presentation.
    I thought I saw a setting for this somewhere, but now I can't find it.

    WaMuHIP07 wrote:
    Right-click the videos that you want to always start from the beginning in iTunes. The options tab of the video file properties contains this option control. Uncheck the box that says "Remember Play Postion."
    Or hit the left side of your scroll wheel when launching it on your iPod

  • "my home page only start from the tabs bar I don't see the top of the homepage

    I have a problem loading my Home page I don't see the top of the home page as the home page only starts from the tab bar I don't see the backward and forward arrows or the menu please tell me how to reload FireFox so that the full home page loads.
    == This happened ==
    Every time Firefox opened
    == Home page only start from the tabs bar I want to see the top part of the home page

    Press ALT or F10 in your keyboard to make the Menu Bar temporarily visible. If you want it to be permanently visible, go into ''View > Toolbars > Menu Bar'', or right-click the Navigation Toolbar (the Reload button, for example) and select ''Menu Bar''.
    If this doesn't help, right-click the navigation toolbar, select ''Customize...'' and click ''Restore Default Set''. If it doesn't appear right away, try pressing ALT or F10. You can go into ''View > Toolbars > Menu Bar'' to make it permanently visible, or right-click the Navigation Toolbar and select ''Menu Bar''.
    If none of this helps, you may be having a problem with some Firefox add-on that is hindering your Firefox's normal behavior. Try disabling all add-ons (just to check), to see if Firefox goes back to normal.

  • UWL: The request cannot be started from the Business Workplace?

    Hi All
    Please assist I am currently trying to execute the standard leave request approval within the UWL. 
    This is the standard leave approval screen for workflow template WS12300111.
    I get the below error in a SAP ECC easy web screen.
    The request cannot be started from the Business Workplace
    Message no. HRTIM_ABS_REQ066
    Can anyone give me any insight to this as I have made multiple  changes tothe UWL config.
    Regards
    Maahir

    BY seeing the error message I think you might have not registered the task in the Portal, as you are have mentioned easy web screen
    1. When ever you are trying to execute the workitem from the UWL and you are able to See the SBWP SAP inbox in the browser then it means that the task of the workflow is not registered in the portal.
    2. Please ask your portal team to register the task in UWL with corresponding visualization parameters.
    [check for the parameters that are to be configured|http://help.sap.com/saphelp_nw04/helpdata/en/20/f0c82c9f6748c58d9ea14b3bbed93a/frameset.htm]
    You cannot execute a leave workitem from the Inbox. if you try to execute then it prompts the error message that you have mentioned.
    Try to do check all the below points.
    1. Check whether the task TS12300097 is registered in the SWFVISU txn  it should be using a Java Application. with the parameters
    APPLICATION     LeaveRequestApprover
    DYNPARAM     wi_id=${item.externalId}
    PACKAGE     sap.com/ess~lea
    2. Second thing is make the task as  General Task from the PFTC txn. so that the agent can approve
    3. Ask the portal guys to register this task in the XML file where all the application specific task's are registred. and then try to execute the workitem, this time it will show you the leave request application.

  • How to remove the option "Set as default background..." from the right-click menu on a picture, for all users.

    Hi! I would like to know if there is any possibility to remove the option "Set as default background..." from the right-click menu on a picture, for all users. I know that's possible to edit userContent.css or userChrome.css, but this concerns only a profile at a time and being in a domain, I would like to set this for all people using Firefox.
    Can it be possible to edit a mozilla.cfg file to get the same result?
    Thank you in advance for help and tips.

    AFAIK then there is no way to do that system wide. You can only do that via userChrome.css or an extension like the Menu Editor per profile .You can install extensions globally, but the user will have to enable them anyway. That is not required for userChrome.css code.

  • Can I download a file in different sessions or should it be in a single session? In other words can I pause the download of a file, shutdown/restart my system and then resume download from where I left off? Or will it start from the very beginning?

    Can I download a file in different sessions or should it be in a single session? In other words can I pause the download of a file, shutdown/restart my system and then resume download from where I left off? Or will it start from the very beginning?

    If a server supports resuming downloads then the download should continue where it left off.<br />
    You can test that by simple starting a large download and wait a minute or so before pausing it.<br />
    Then you can close and restart Firefox and see if resuming works.
    You can set the pref browser.download.manager.quitBehavior to 2 on the about:config page.<br />
    That will make Firefox ask for confirmation if you want to cancel the download if you close Firefox.
    See:
    * http://kb.mozillazine.org/browser.download.manager.quitBehavior

  • My iDVD project won't start from the menu.

    When I create a DVD, it will not start from the menu but goes directly to play.  I can force it to the menu by clicking the "Disc Menu" button on my remote,  This happens on both of my DVD players, one or which is a Bose system.  I didn't have this trouble with DVDs created using my older G5 iMac.  This doesn't happen on all DVDs using the newer iMac.  I've used the "Revolution" theme and it seems to work OK.  For this current project, I used "Full Screen" from the list of older themes.
    I'm using iDVD 7.2.1 on an Intel iMac running OS10.6.8
    Thanks for your help,
    Jim

    Go to the Map mode in iDVD and make sure there are no items in the far left hand Autostart bin.
    If there is just drag it out, save the project as a disk image, File ➙ Save as Disk Image menu option, and test with DVD Player. If it plays OK with DVD Player the encoding was good and you can then burn to disk with Disk Utility at the slowest speed available to assure the best burn quality.  Always use top quality media:  Verbatium, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    Happy Holidays

  • Icons in the addon bar have moved from the right hand corner to the left

    Hi everybody,
    I've recently updated to the most current Firefox 4b10. I'm currently using the addon bar on the bottom that holds several addon-related icons (like firebug etc.). Those do still work, but for some reason they have moved from the right-hand corner of the addon-bar (where they have always been) to the left side for no apparent reason.
    I know it's kind of a little issue, but it is really disturbing since I keep looking in the wrong corner after having the icons there for so many years. Is there any way I can revert that?
    Thanks!
    mrmister

    Please report this problem to Firebug team,
    http://code.google.com/p/fbug/issues/list

Maybe you are looking for