Replacing spaces?

I have an instance of NSMutableString. I want to replace all spaces with a + sign, but when I try:
[string replaceOccurrencesOfString:@" "
withString:@"+"
options:NSAnchoredSearch
range:NSMakeRange(0, [string length])];
nothing happens. Any ideas?

NSAnchoredSearch only applies when your string has the string to replace ("+") at the beginning or end. Matches in the middle are ignored.
You need to use a different parameter.

Similar Messages

  • Replacing spaces with dashes

    Photoshop CS4 is replacing spaces in the filenames with dashes. How do I make it stop doing that?

    in save for web? look at the options. probably set to unix file systems. you know that file names on the web (if that's your intended use) may not contain spaces, rigth?

  • Replacing space with some char in report display

    dear friends
    hw can i replacs space in report display with char .
    there is disply like
                     site 1    site2   site3
    matnr1           space      10        space
    matnr 2            2        space     space
    site in x -axis  ,matnr in -y-axis.
    i want to replace this space  by some char like nd or ns  etc
    can any one give solution....
    regards
    veera

    hi this my condtion .....
    if the first condtion satisfed i have to replace by ND
    which is now mentioning as space.if send condtion satisifed  having 10(na) in display
    loop at it_final1.
                        read table it_final2 into wa_final2 WITH KEY matnr = it_final1-matnr.
                               IT_RESULT-matnr = IT_final1-matnr.
                               IT_RESULT-WERKS = IT_final1-vstel.
                        if it_final1-LFimg = wa_final2-vsolm.
                             it_result-LFimg = 'nd'.
                            ELSEIF IT_FINAL1-LFIMG < WA_FINAL2-VSOLM.
                                 it_result-LFIMG = WA_FINAL2-VSOLM - IT_FINAL1-LFIMG.
                                 ELSEIF WA_FINAL2 IS NOT INITIAL.
                        IT_RESULT-lfimg = IT_final1-lfimg.
                        else.
                        IT_RESULT-lfimg = IT_final1-lfimg.
                                     ENDIF.
                        COLLECT it_result.
        ENDLOOP.

  • Filename: Replace spaces with underscores

    Greetings,
    I have searched the forum and online and have not found an
    answer.
    So posting here for assistance.
    What is the proper syntax for replacing spaces in file names
    with under
    scores prior to cffile upload? -or- what is the best method
    to accomplish
    this process?
    Example:
    document name.doc >> document_name.doc
    Thanks
    Leonard

    you can't change the filename before the file has been
    uploaded to your
    server.
    upload a file using cffile.
    #cffile.serverfile# variable will contain the name with which
    the file
    has been saved on your server.
    check if the name contains any spaces using find() cf
    function.
    if it does, use cffile action="copy" to copy the file as a
    file with no
    spaces in the name (use replace() cf function to replace
    spaces with
    whatever you want).
    [you may want to make sure prior to copying the file that
    there is not
    already a file with same name (with no spaces) in that
    folder, otherwise
    the copy action will overwrite existing file]
    delete original file.
    details of all the functions are in the CFML Reference. if
    you do not
    have one - download free from adobe.com
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Replacing space with special char in reporting

    I have created a calculatd Keyfigure where if the consition given in the calculated KF satisfies then it displays 1 otherwise space ,now mu user wants space to be replaced by some special charcter
    Example
    My ckf is like this overallscore >= 90 & Iam applying count on this
    Vendor   CKF
    X              1
    Y
    Z                1
    As vendor y is not satsifying the condition its showing with space now I want to replace space with some special char how is this possible

    Hi Priya,
    You can try this: Instead of space, fill this with a 0. Then in the query properties, set the Show Zero As and give your special char, like may be *. But this will be okay if you do not have other zeros in the report...else you may need to do some VB coding.
    Hope this helps...

  • Read a spreadsheet and replace spaces

    I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
    How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
    <cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

    I am using a cfspreadsheet tag to read excel file. Since, I am using QoQ, the file import errors out since the header row has spaces in it?
    How do we read the header row specifically and replace spaces and save the file before moving forward? Thanks
    <cfspreadsheet action="read" src="c:\WellRecords.xls" query="qryRecords" headerrow="1" sheetname="1">

  • Replace spaces in CFFILE upload with - ( part II )

    I had it working, I know I did...
    #rereplace was doing just what I needed but for some reason
    it wont work now,
    and I am going insane.
    Is there another way to replace spaces in a file name during
    the course of a CFFILE upload?
    I want to replace any spaces in a file name with a hyphen,
    directly after uploading, before anything else is done
    ( or during file upload if possible).
    Michael Evangelista
    Evangelista Design / Evangelista Consulting, inc.
    www.evangelista-web.com
    Custom Small Business Website Solutions

    THANK YOU DL.! perfect!
    Michael Evangelista
    Evangelista Design / Evangelista Consulting, inc.
    www.evangelista-web.com
    Custom Small Business Website Solutions
    "dlashier" <[email protected]> wrote in
    message news:e8fijc$oi9$[email protected]..
    > <cfset srawname =
    REReplace(rawname,"[[:space:]]","","ALL")>
    >
    > will strip them, obvious change to replace with dash.
    >
    > - DL

  • Layers to files: replace spaces with underscores

    How can I update the script to replace spaces with underscores on export? I assume I need to add a line somehwere between 183-195 but I don't know what it needs to be. Thanks in advance.

    Where did you get the Layers to files script. Photoshop versions ship with a "Export Layers To Files.jsx" CS6 lines 183-195 look like this I see nothing about filename
      var layerSetsCount = app.documents[docName].layerSets.length;
             if ((layerCount <= 1)&&(layerSetsCount <= 0)) {
                if ( DialogModes.NO != app.playbackDisplayDialogs ) {
                    alert( strAlertNeedMultipleLayers );
                            return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script
            } else {
                var rememberMaximize;
                var needMaximize = exportInfo.psdMaxComp ? QueryStateType.ALWAYS : QueryStateType.NEVER;
                if ( exportInfo.fileType == psdIndex && app.preferences.maximizeCompatibility != needMaximize ) {
                    rememberMaximize = app.preferences.maximizeCompatibility;

  • Replace spaces with a + sign

    Hi,
    In on of my columns I have a text... I want to replace spaces with a plus (+) sign... something linke this
    select
    text_field,
    Function_replace(text_field, " ", "+") new_field
    from
    table_A

    It's almost that:
    SQL> with table_a as (
      2  select 'abc dd   efg ' text_field from dual)
      3  -- end of sample data
      4  select text_field, replace(text_field, ' ', '+') new_field
      5    from table_a;
    TEXT_FIELD    NEW_FIELD
    abc dd   efg  abc+dd+++efg+
    SQL> edit:
    If you want to replace any number of consecutive spaces for a single + sign, then:
    SQL> with table_a as (
      2  select 'abc dd   efg    h' text_field from dual)
      3  -- end of sample data
      4  select text_field,
      5         regexp_replace(text_field, ' +', '+') new_field
      6    from table_a;
    TEXT_FIELD        NEW_FIELD
    abc dd   efg    h abc+dd+efg+h
    SQL> Edited by: fsitja on Mar 31, 2010 12:27 AM

  • Syncing hebrew notes with icloud distorts them by replacing spaces with exclamation marks. how do i fix this?

    syncing hebrew notes with icloud distorts them by replacing spaces with exclamation marks. how do i fix this?

    I'm syncing my iPhone 5 and my iCloud account. I open the account on my PC with a Google Chrome browser.
    iPhone:
    The same note on iCloud:
    So.. Any ideas?

  • Need to replace space bar on keyboard

    I need to replace space bar on my keyboard of my HP Pavilion Entertainment PC.
    It has been completely pulled off and won't click back. I think that little brackets are broken too. I don't know where to go to find the replacement or to have someone replace it for me. Please advise.
    Thank you

    Hi
    Is your warranty valid?
    In such case recommend contacting the ASP in your country to replace the kneeboard since this would be covered by warranty and it would be done free of charge.
    As far as I know the keyboard replacement procedure is the same like for the R700 Portege series
    Its difficult because you will need to remove other parts like
    Battery, sim card, express card slot, memory modules, base assembly to get access to an
    aluminum tape from the back of the cover assembly. Then you could turn the cover assembly face up and peel off the keyboard adhered to the insulator.
    And additionally you can not use the removed keyboard and keyboard insulator again. You will need to use new parts.

  • CLOB to BLOB replacing spaces with Â

    I have a CLOB that we are converting to a BLOB using DBMS_LOB.CONVERTTOBLOB and then serving it up as a file using WPG_DOCLOAD.DOWNLOAD_FILE. When you open the file, it is replacing the spaces with a Â.
    Any thoughts?

    Most likely, the spaces in the original CLOB were not regular spaces (0x20) but rather non-breaking spaces (0xA0).
    What's the target encoding used to convert to BLOB? I suppose UTF-8?
    UTF-8 encodes non-breaking spaces as 0xC2A0, where 0xC2 is specifically the codepoint for "Â". So I think the tool you're using doesn't support UTF-8, or doesn't recognize the file as being properly encoded.
    Edited by: odie_63 on 14 août 2012 14:26

  • Replacing space in GO URL with %20

    Hi,
    I have created a GO URL and passing the branch name to the target report. The target report has "Is Prompted" filter for the Branch.
    The branch names has spaces between them. eg: "AAA - BBB" like this. To replace the space, i have used the following: REPLACE("EMPTrack".BRANCH,' ','%20') it is also encoded as "AAA%20-%20BBB"
    But when the request is run and the Branch name is navigated to the target report, the space in the branch name is replaced with "," instead of space itself.
    Kindly help me.
    Regards,
    Bhuvan R

    Hi ,
    Try to use '+' sign.

  • HELP : Replacing Space with any character !

    Hi !
    How do I replace any spaces in a strings passed from a FORM INPUT, with a different character.
    I tried doing this
    String s= request.getParameters("info");
    s.replace(' ','_');
    But it keep giving me error.
    it there any simpler way of doign this?
    Thank you
    K

    Hi !
    I am new to JSP,
    It keep giving a null pointer exception when i use it with JSP
    So i did this it work fine on the try section
    and once it is in the catch section it keeps giving me Nullpointer exceptions again.
    IS there any other way replacing the space with a "-" or anything..?
    Thanks for your help.
    here is the code
    String r_space ="";
    try {
         r_space=value.replace(' ','+');
         out.println("r_space : try " r_space "<br>");
    catch(NullPointerException e) {
    System.out.println("Recaught: " + e );
    r_space=value.replace(' ','+');
    out.println("r_space : cathc" r_space "<br>");

  • Replacing Space in csv

    Hi,
    I have a csv file and I need to replace the space in the TEST column. I believe there is a relplace cmdlet, however that is not working.
    "Count","TEST "
    "535","005120 "
    "738","005130 "
    "529","005211 "
    I need the output to be something like this.
    "Count","TEST"
    "535","005120"
    "738","005130"
    "529","005211"
    Thanks

    Here is how to recondition CSV files:
    import-csv j.csv |
    select count,@{N='Test';E={$_.'test '}} |
    export-csv j2.csv -notype
    ¯\_(ツ)_/¯
    That still leaves a trailing space in the data row, but is otherwise pretty much identical to what I posted.
    I was trying to fix it when the web site went crazy - I gave up.  I just fixed it and the web site is working again.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • When Flash Builder 4.6 for PHP is released will it support AIR 3.2 ???

    We've all been waiting a long time since last November's Private Beta of Flash Builder 4.6 which was released shortly thereafter, for the Flash Builder 4.6 for PHP version. However, Flash Builder 4.6 for PHP (The one with Zend Studio included in it)

  • Problem to weblogic start managed server "OraSDP"

    Hi all, first, sorry if this location is not correct to this thread. I have a problem when I start a weblogic managed server, which indicates there is an error to check a QueueConnectionFactory into JNDI. The log of this error is next: <16-feb-2011 1

  • Screen cracked after 3 days

    hi Ive just upgraded to a z3 after two years of having a z. The screen has cracked in several places when it was in my hand bag not being used. I've booked a repair through Sony but researching online tells me that I will be charged handsomely for th

  • Delivery document number

    hi all,           The Delivery document number of SBO was different from the doc # on e-commerce. Can it be the same as SBO? Regards, Phil

  • Cost element/activity type planning upload

    Hi, When doing the cost element/activity type planning upload via KP06, can I assign only one characteristic in the element definition level?   Because I want to put in the excel upload layout  the cost elements, cost centers and activity types.  But