[JS - CS3]  Can't REPLACE A with B within a string? Help Please...

Hello Experts,
First off - I'm a newbee to all this JS and especially with CS3.
I have a string: '
b myDocumentName
which can have it's value as: '
b 00000en_ Generator WX/WY
Problem is, backshlashes ( / )are a bad thing for me...
b Question:
How can I do a 'replace' operation to replace the '/' from the string with a '_'?
I have at the moment:
> var myDocSaveName = oneResult[3]+oneResult[4]+oneResult[5];
> myDocSaveName.replace(what "/", with "");
> myDoc.save ("C:/DATA/"+myDocSaveName, undefined, undefined, true)
I get an error Nr. 25... Offending text:"/"
What am I doing wrong?

'what' and 'with' are the names of those arguments. They should not be included in the statement:
myDocSaveName.replace("/", "");
But that still won't work because replace doesn't operate on a string in situ, it returns the modified string. So:
myDocSaveName = myDocSaveName.replace("/", "");
This too has its limitations. It'll change only the first instance of "/", not all of them. To change all of them, you need to restate the 'what' as a RegExp:
myDocSaveName = myDocSaveName.replace(/\//g, "_");
A RegExp literal is delimited by the "/" character, so to have it, alone, as the character to be sought you must use the backslash to escape the character. Then, to indicate you want the replace to happen globally within the string, you add the 'g' after the RegExp.
Dave

Similar Messages

  • How can i replace backslashes with fowardslashes in a String

    Hi all,
    I hope someone can help me with this stupid problem iv been having, i need to replace all the backslashes in a String with forwardslashes.
    The method replace() doesnt work because it uses Chars, also i cant use replaceAll() because im restricted to using jdk1.3.
    I would really appreciate some help here,
    Thanks

    Or in other words, I have no idea what you're talking about:
    public class Foo {
         public static void main(String[] args) {
              String s = "string with \\ back \\ slashes \\ in \\ it !";
              System.out.println(s.replace('\\','/'));
    }

  • I I have a late 2005 power PC G5 that I want to bring back to life.  I need to replace the original hard drive, a Maxtor 250 GB Sata.  Can I replace it with modern drives, SATA 5-6 etc?

    I have a late 2005 power PC G5 that I want to bring back to life.  I need to replace the original hard drive, a Maxtor 250 GB Sata.  Can I replace it with modern drives, SATA 5-6 etc?

    I knew I should never get rid of my old G5's.  By the way, there is a browser still supported for the PPC, TenFourFox, if you're not using it already.  Go to the Floodgap website (they author it)  download it for free.  The only thing it doesn't support is the Flash plugin, but the browser works great. Other video types are supported.  It's based on Firefox, and runs most of the plugins and add-ons. It's very fast, and beats all other browsers on the browser compatibility and speed test.  That's now my default on my G5's.  Firefox and Safari are no longer supported.  As far as the OS, both Tiger and Leopard were solid for me.  The reason, as I stated before, was iMovie.  The version in Tiger with iLife was far superior to what Apple changed it to.  They 'dumbed it down' for the masses.  Even the newest iLife 11 on my Mac Pro quad isn't is good, in my opinion.  So Leopard should be fine for you.  It's a much larger browser in terms of sheer megabytes and disk space, but it's fine.  As far as getting an OS disc, I'm seeing Tiger for about $45.00, Leopard for $50 - 60.00 on that famous auction site.  As far as RAM, I have 8GB in my G5 2.3, but you should check Activity Monitor when you are running your apps.  See how much green slice you have left (unused RAM).  You might find you don't need eight.  A Mac Pro will grab more free RAM than a PPC machine will.  I have a hard time maxing out use of my 8 on the PPC.  Not true with the eight on my Mac Pro.  The OS doesn't hesitate to grab and use it.  You might be OK with 6GB on your PPC. More will not make you faster, as long as you still have free RAM available.  As far as backup on your resurrected machine:  look for a firewire enabled backup if can.  Use CCC (Carbon Copy Cloner) and make a clone backup.  Next time your PPC machine wipes out the hard drive, just take your Firewire drive and plug it into another PPC machine, and you can select it as your boot drive. You'll be back and running in five minutes.  You can also take the physical drive out of your enclosure, and put it in your tower to replace the failed drive, and you'll be back to where you were in less than ten minutes, OS and all.  The PowerMac has an 800 port, so you can do the 800 on the machine to an 800 port on your backup. A firewire 800 to 800 cable is only about $8.00.  It runs nice and fast through the 800 port.  I like the OWC Mercury Extreme enclosures.  They use USB, Firewire 800, and eSATA, so all your options are open.

  • Can we replace OracleSytemUser with a custom user in ldap?

    HI,
    We have installed soa 11g and configured Microsoft AD as ldap provider.
    I have couple of questions around this.
    1. Can we remove the default embedded authenticator totally? If yes what are the things we should keep in mind?
    2. We don't want hard coded users like "OracleSystemUser". Can we replace OracleSystemUser with our custom user, maybe assinging our user to OracleSystemGroup in our ldap.
    Would appreciate any help.
    Thanks
    Manish

    There are Office-type apps available for iPad.
    Skype is also available for iPad.
    Whether you, specifically, can completely replace a laptop with an iPad depends on what you use your laptop for. The iPad is not designed to completely replace a laptop. There are many things a laptop can do that an iPad cannot. Whether those limitations are an issue for you, depends on your laptop usage.

  • Can I replace CUA with CUP. If not why or what will be the risks

    Hi,
    The client does not want to have two provisioning systems CUP & CUA. The sole purpose they are using CUA is the proper accounting for SAP licenses such that the user ID remains the same across the landscape. No other purpose of using CUA. In this case can I replace CUA with CUP 5.3 SP12.
    Thanks & Regards,
    Sanjeev

    There are limitations to doing that.
    CUA has a technology focus and does not take access risk into consideration at all. The long-term successor of this would be Netweaver Identity Management. If you want to consistently manage user master data and license information, that's probably the solution to look at.
    You can perfectly use CUP on top of that to manage authorizations. You can also force CUP to only allow user IDs from a central system like CUA or ActiveDirectory in order to enforce user ID consistency.
    What CUP will not do is give you an overview of where a user is maintained with which kind of information/license data. That is something that either CUA (for ABAP only) or Netweaver Identity Management will give you.
    Frank.

  • I'm replacing a bad hard drive on my imac.  It was a 500GB Seagate 7200.12.  Can I replace it with a 1TB Seagate 7200.14 HDD??

    I'm replacing a bad hard drive on my imac.  It was a 500GB Seagate 7200.12.  Can I replace it with a 1TB Seagate 7200.14 HDD??

    Yes of course.

  • I have an iphone 4 and it's not working, if i pay can apple replace it with the same model even though it's no longer for sale?

    I have an iphone 4 and it's not working, if i pay can apple replace it with the same model even though it's no longer for sale?

    If the iPhone has not been opened or serviced by other than Apple
    or authoriized service provider (there are a few other requirements),
    you should be eligible for out of warranty replacemement for $149 US.
    Apple maintains sufficient stock for replacements even for iPhones that
    are no longer available for purchase. You may be better off upgrading to
    a newer version than paying $149 to stay with the iPhone 4.
    What is no longer working? If you provide more details as to the problem
    and what troubleshooting steps you have taken, some one may offer
    a solution.

  • I have a late 2012 mac mini with an i5 2 core can I replace it with an i7 quad core?

    I have a late 2012 mac mini with an i5 2 core can I replace it with an i7 quad core?

    A few places online may still offer the i7 2.3GHz quad-core Late 2012 MINI (Oct 2012 to Oct 2014)
    that allows the user-upgrade of RAM to 16GB, and this one I've seen is a Server model and has
    two 1-TB Hard Disk Drives. The B&H store in NY online has this listed, if in stock now, price &
    shipping in continental US is good until tomorrow.
    Your i5 dual-core is still desirable to many, & you may be able to resell it if not needed.
    Good luck & happy computing!

  • I have a iPhone 5s fell into the water and damaged fingerprint sensor motion and lines of light appeared on the screen, but it still works and did not hurt anything else Can I replace it with a new phone

    I have a iPhone 5s fell into the water and damaged fingerprint sensor motion and lines of light appeared on the screen, but it still works and did not hurt anything else Can I replace it with a new phone

    No. The warranty does not cover damage.
    You can only get a replacement if you can talk Apple into selling you and out of warranty replacement.
    Allan

  • Hi Apple Team, my iphone can't share files with my macbook pro. But other devices can share bluetooth files with my mac book pro. Please, kindly open up bluetooth to accept all connections from all devices. Now it becoming difficult for me to share.

    Hi Apple Team, my iphone can't share bluetooth files with my macbook pro. But other devices can share bluetooth files with my mac book pro. Please, kindly open up bluetooth to accept all connections from all devices. Now it difficult for me to share bluetooth files from my mac bookpro to my iphone, unless i attached it through email.
    We need it to be acceptable to all devices.
    Thank you!

    You can tell Apple directly at the link below.
    http://www.apple.com/feedback/iphone.html

  • I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    I have family plan of 5 iphones and all them have the same apple id, the q. is how I can set each one with their own apple id? please advise...

    See How to Stop Sharing an Apple ID.
    (Note that I am affiliated with that site, and some pages contain ads).

  • After hours of back-up, downloading and uploading...I am now updated with all the latest Mac software. However, I no longer have access to Excel and Word. Is there a way I can access my documents in either of those? Help, please.

    After hours of back-up, downloading and uploading...I am now updated with all the latest Mac software. However, I no longer have access to Excel and Word. Is there a way I can access my documents in either of those? Help, please.

    If you have older versions of excel and word that previously ran under the Rosetta emulator (allows PowerPC code to run on Intel system), they will no longer work with Lion.
    You can use the Apple programs Pages and Numbers to access the files. They can be bought and downloaded from the App store. NeoOffice is available at http://www.neooffice.org/neojava/en/index.php which has Lion support. OpenOffice doesn't talk to Lion support, it's at http://www.openoffice.org/

  • I spilled some sugary liquid on my Macbook keyboard, I can mirror this computer with another mac and it works find but I can't see anything on the macbook monitor. Help, please!

    I spilled some sugary liquid on my Macbook keyboard, I can mirror this computer with another mac and it works find but I can't see anything on the macbook monitor. Help, please!

    There really isn't any workaround to the cost. You can't get the parts needed to fix it yourself. Only Apple has those parts and they do not sell them to end users.
    Sure you could take it apart and clean everything and the screen might start working again but then it might not. Depending on what cause it to stop working in the first place. Like something got shorted out.
    mike1206 wrote:
    Apple wants 1,200 dollars to fix. I'm trying to work around that cost.

  • Hi there, I have much files saved on pages ( ios ipad) , I just open it today and did not find .all the files !!!! Just 4!!! Taken in consider that I did not delete or making any wrong action. How I can return the lost files!!!! Help please

    Hi there, I have much files saved on pages ( ios ipad) , I just open it today and did not find .all the files !!!! Just 4!!! Taken in consider that I did not delete or making any wrong action. How I can return the lost files!!!! Help please
    its very important files!

    tis true
    I know, I always do that but I was in a rush to get somewhere and I was relying on my thousand dollar Mac to do some kind of recovery or something. I know Microsoft always keeps temporary files (I think Mac does too, part of me asking here in this forum was for someone to tell me where I can find those files) and when you go to open Office Works then it gives you the option of opening the last recent documents, saved or not saved.
    I usually copy paste into my emial just in case something goes wrong with the created document but I just didn't have the time to login and do all that My loss, you live and you learn, BUT still if ANYONE got any info on this, PLEASE DO CHIME IN *keeping the hope alive*

  • In my Iphone 5, Nothing on my App Store is working its displaying blank (Except for Genius section). I've tried to uninstall and install itunes and all its component but still it doen't fix. Not sure if its problem with apple servers. Someone help please!

    In my Iphone 5, Nothing on my App Store is working,  its displaying blank (Except for Genius section). I've tried to uninstall and install itunes and all its component in my desktop but still it doesn't fix the app store issue. Not sure if its problem with apple servers. Someone help please!

    settigns>itunes and app store to make sure you are signed in.. If  you are, you will see your account name..... anyhow, click your account name, sign out and sign back in
    also go to to settings>general>reset and reset network settings... if that doesnt work settings>general>reset and reset all settings!
    one of those shall work. The last step would be to restore your device (apple.com/support) HT1414

Maybe you are looking for