Replace '\n' by space

Dear friends,
I am developing a project. In which i need to convert a string containing '\n' by space. Can any one of you help me.
i had tried string.replace also.
Advance Thanks
Rengaraj

Hmmm...
I wrote that regex the way I did because I didn't want to replace every single space with another single space--a very expensive redundancy. But looking at it again, I see that it won't replace single TABs, formfeeds, etc.. Here's a better way:   str = str.replaceAll("(?! \\S)\\s+", " ");

Similar Messages

  • Preventing Discoverer Admin replacing underscores with spaces on refresh

    Hello,
    On refreshing a Business Area, Discoverer Administrator will automatically replace underscores with spaces for any new items/folders to be incorporated. I would prefer this not to happen i.e. the names should retain the underscores. I haven't found any way to do this from within Discoverer Admin - are there some registry settings that I can tweak or is it just not possible,
    Thanks in anticipation,
    Kevin.

    Hi,
    Well, you could try using a eul_trigger$refresh_new_column trigger. I must admit I have never tried this, but the details are in the documentation (http://download.oracle.com/docs/html/B13916_04/appendix_b.htm#sthref2417).
    Rod West

  • Hi, Im using apple 5s with gold color , I want  to replace it with space grey  color .Is it possible in apple store?

    Hi, Im using apple 5s with gold color , I want to replace it with space grey color .Is it possible in apple store?

    If you are within the return period policy of the retail where you purchased the
    iPhone, return it and buy a new one. If outside the return period, sell the current
    iPhone privately and use the money received toward a new iPhone. Or buy a
    case in your preferred color for your current iPhone.
    If purchased from Apple US, return period is 14 days. I believe it is the same elsewhere,
    but check with your local Apple store. Be advised, that even if you are within the return
    period, returns are accepted only in the country of original purchase (EU is one country
    for this purpose).

  • Replacing comma with space

    Hi,
    Note : I am using SAP 4.6
    Task      : Replace Comma with space
    Problem : Not able to replace comma with space
    I have task where I have to write result file to application server, when I am writing string to application server it is separating by comma, for example if you take below statement it is dividing by space that means in first column PO and then ITEM etcu2026.
    MOVE  'PO ITEM is not there in table EKPO' TO W_RECORD_OUT-ERROR_MSG.
    so to resolve this situation I have used below code for now, I know I can use
    REPLACE ... ALL ENTRIES but this statement is not working in SAP 4.6
    REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
    appreciate if somebody can help me.
    Thanks
    sarath

    Hi,
    Please check the below code.
    REPORT  YSAT_TEST.
    Data: Var1(40) type c value 'Test1,Test2,Test3,Test4'.
    break-point.
    REPLACE ',' WITH space INTO Var1.                   " It will replace only first occurrence
    replace all occurrences of ',' in var1 with '   '.
    CONDENSE Var1 no-gaps.
    write: var1.

  • Carriage returns are replaced by blank space in SOAP message.

    Hi,
    i am using SOAP request based website. i am using the weblogic webservices. when we sent any SOAP request to the server, if the SOAP xml message contains any carriage returns(new lines) are replaced by a single balnk space.
    i have a requirement where user can enter details in multiple lines. but by the time when it readched server, the SOAP xml message has changed. all the carriage returns are repalced by a blank space.
    Can you please help how to solve this issue.
    Thanks
    subba.

    What are your trying to accomplish?
    I'm thinking you are trying to get a several 'fields' together as a single 'string'. In which case I'd simply concat the fields together like
    SELECT a, b||' '||c ...
    to create a single string with "contents of b space contents of c"
    If you are trying to get one hundred and one blanks, of make a field 101 characters wide with blank padding, then you want to look in the SQL Reference manual for things like lpad, rpad and trim.

  • Replacing # with blank space in Bex Analyser

    Hi All,
    Can any one help me out in replacing # values in Bex analyser with blank space.
    I tried with the macro:
    Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
    ' First Query in the workbook
    If queryID = "SAPBEXq0001" Then
    ' Selects the area where the report query is rendered
    resultArea.Select
    'Replace "" with 0
    Selection.Cells.Replace What:="", Replacement:="0", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
    End If
    End Sub
    Means I have include the macro to the Excel, but still it is not working.
    If this macro is the correct solution, then may be I am not using it properly(in the sense I'm not calling with proper syntax).
    Please provide me with the solutiuon to get rid of this problem.

    Hi,
    We are using BEX 7.0.
    I got a macro code which is working. The code is as follows.
    Dim resultArea As Range
    Set resultArea = varname(1)
    Dim c As Range
    For Each c In resultArea.Cells
    If c.Value = "#" Then c.Value = " "
    Next c
    This works fine but the problem is that this macro code should be added each and every time when the query is run.
    Can any one suggest me where the code can be added in Bex Analyzer itself, so that when the query is run the above macro runs along with it and removes the #.
    Thanks and Regards,
    Geetha.

  • How to replace apostrophe with space

    Hi Experts,
    I need to replace the Apostrophe in Material description with space. I am getting a error as the text literal .....longer than 255.
    highly appreciated for immediate response.
    REPLACE ALL OCCURRENCES OF ''' IN WA_MAKTX WITH ''.
    thanks,
    RRR

    Hi Rammi,
    Hi have tried with the below code and I am getting the proper output as well.
    DATA wa_maktx(10) TYPE c.
    wa_maktx = 'as"dfg'.
    REPLACE ALL OCCURRENCES OF '"' IN WA_MAKTX WITH SPACE.
    write:/2 wa_maktx.
    output:
      asdfg
    Regards,
    Md Ziauddin.

  • Replace every empty space the beginning and the end

    Hi All. I want to use get-content and -replace to replace empty spaces:
    The text file
    Line1:abcd
    Line2:cdef
           Line3:jukq
    Line4:casdj

    First of all, this isn't relevant to DPM so would have been more appropriate being posted in
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverpowershell and potentially have a better chance of being replied to before now.
    That said, doing what you're after is fairly straight forward, though the exact method depends on what you're trying to achieve.
    If you want to update the existing file c:\input.txt so that same file ends up with the spaces removed, then use :
    (Get-Content C:\input.txt) |
    Foreach-Object {$_ -replace " ",""} |
    Set-Content C:\input.txt
    Alternatively, if you're trying to load those values into a variable ($foo) but with the spaces removed then you can use :
    $foo = (Get-Content C:\input.txt) |
    Foreach-Object {$_ -replace " ",""}

  • Replace POSIX path spaces with %20

    Lets say I have this:
    tell application "iTunes"
    set theLocation to location of current track
    set theLocationPOSIX to POSIX path of theLocation
    end tell
    How can I replace every space in theLocationPOSIX to %20 so that it is HTML friendly? I am embedding it in a web page, and the iPhone doesn't seem to assume that the spaces should be %20s.
    Thanks.

    try
    tell application "iTunes" to set currentTracklocation to ((location of current track) as string)
    set {oASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, space}
    set currentTracklocation to text items of currentTracklocation
    set AppleScript's text item delimiters to "%20"
    set currentTracklocation to currentTracklocation as string
    set AppleScript's text item delimiters to oASTID
    set theLocationPOSIX to POSIX path of currentTracklocation
    end try

  • Replace string by space

    I would like to replace all ',' appear in a strng by space. So, i use
    replace all occurrences of ',' in tempStr with space.
    But, the outcome is all pattern are replaced, and concatenate together. For example, i have string
    tempStr = '1,2,3,4,5,6,7'
    But the result is
    tempStr = 1234567
    How can i replace the string by space. thanks!

    Hi,
    Try this.
    data : tempstr type string,
    temp(2) type c.
    tempStr = '1,2,3,4,5,6,7'
    temp = ', '.
    Translate tempstr using temp.
    Write tempstr.
    Regards,
    Mohaiyuddin

  • TS3554 Tried setting login password on recently returned iMac after Seagate hard drive replaced. No space to type in a password or confirm it appeared so I chickened out and clicked on red dot to shut down window. I did, however, put my name as admin. now

    Tried setting login password onto iMac after it returned from Seagate exchange hard drive. Upgraded from leopard, snow leopard and currently upgraded to Lion, so as to have iCloud.Typed my name in as administrator and waited for a space to appear to type in password and confirm it. No space appeared so I shut that window down. Put iMac to sleep and when I returned and tried to access computer, it asks for a password which I did not put in! Now I'm stuffed. Cannot get into computer at all. Help appreciated. I'm not a techno wizard.

    Welcome to the Apple Support Communities
    Reset the password > https://discussions.apple.com/docs/DOC-4101

  • SFP Replacing 0 with Spaces

    Hi,
    I have  fields in a table in a form created using SFP. When these fields have 0 or 0.0 I  do not want to print any values, I just want a space to print.  I've tried numerous attempts using PATTERN without any success.  The fields in the interface defines these fields numeric and/or decimal.
    Any help would be appreciated.
    Helen

    Hi,
    Take a variable of type c  with length same as your original variable (If original variable have 10 charactes and two decimal with sign then declare new vriable text_new of type char13).
    Note : this TEXT_NEW should be declared in global definition of smartform type char13.
    Now take a program logic just befor this text being printed and assign value to this new variable and in program logic write a condition
    clear text_new.
    text_new = original_value   " assigned original value
    if text_new is initial.
    text_new = space.
    endif.
    Now print this new variable.
    It should definitly resolve your issue.
    Please try and confirm.
    Regards,
    Umang Mehta

  • Replacing Text with Spaces

    What is the fewest lines of code needed to transform:
    'this is a test--have a look'
    with
    'this is a test'
    the idea is to find the '--' in the string and blank out everything after that.
        Thank-You

    >
    Tom Matys wrote:
    > Rob, I try to use this forum quite seriously. If my question was incomplete you can let me know.
    >
    > Otherwise, I suggest you read "The Rules of Engagement"
    >
    > Step 5: Answering a question
    > The community lives by people like you, trying to help others. When you see an unanswered question where you think you can answer, do so and help the poster. Remember to be polite and if you do not completely understand a question and need more details, request more information from the poster.
    >
    >                   Thank-You.
    Good point - let me explain
    I don't think the rules of engagement say this, (at least I don't see it) but if you expect a good answer, you have to ask a good question. I think that if you check, you'll see that my answer completely and correctly answers the question that you actually asked. (I tested it.)
    But to be fair, my answer was meant to ask to think about what you are asking and why you are asking such a question. Is your server so limited in storage space that you have to be concerned about the physical size of programs. Or is the question meant to be performance related? Or something else entirely?
    But also to be fair, you have asked almost 500 questions and seem to be asking the forum a question that you really ought to think about yourself. Those rules of engagement also talk about searching for a solution before asking and explaining what you have done to find a solution in your question.
    Rob

  • Weird rectangular box replaced the white-space for san serif

    I opened up a pdf that used to have a normal san serif text, but now, it has little square boxes for every spacebar spaces. The text comes out good but it's the white spaces that come up in square characters. Most other fonts don't do this but some other ones do this as well. Here is a picture of it:
    http://i574.photobucket.com/albums/ss186/johnclee90/1212.jpg
    please help me.

    I meant to say InDesign and not pdf. The pdf output of the indesign long ago does not have any square boxes but if I try to export the same indesign into pdf, it has the square things showing up on the pdf as well.  Anyways, the sansserif might have already existed, but my actual use of the sanserif came along with an already made CS2 template (I have CS3)from my instructor which was using the font. Everything was fine and normal (as in no square boxes) until recently when I opened the file again.
    I checked the font folders in my windows system, and it has SansSerif, SansSerif Bold, SansSerif Bold Oblique, and SansSerif Oblique in truetype font just like any other font files in there.
    Also this is the original CS2 template that I work on from. When I first opened this a while ago, it didn't have the weird boxes.
    http://i574.photobucket.com/albums/ss186/johnclee90/111.jpg
    could it be that I've installed new fonts to my system since that time?

  • How do I replace multiple consecutive spaces with a single space?

    I need to convert any occurrence of multiple consecutive spaces in a string to a single space. How do I create the regex pattern to do that?

    r9973 wrote:
    Sorry, more like: String test = "Some        Text       Here"Want to convert to String test = "Some Text Here"
    Post the code that you used to test the regex. I just tried it and it worked fine for me. All you need to do is apply the regex replaceall to your string variable that holds the string
    String test = "Some        Text       Here";
    test = test.replaceAll(" +", " ");
    System.out.println(test);And thats it.

Maybe you are looking for

  • Error Message while downloading itunes

    It tells me I don't have access to download. Tells me I should log on to administrator or contact system administrator. I am definitely logged on as the administrator. Any suggestions?

  • Changing to Transformations

    Dear All, Now I changing the update rules to Transfermations. could any one guide me how to take care of the bellow statments in BI7 if the returncode is not equal zero, the result will not be updated     RETURNCODE = 0.   else.     RETURNCODE = 4.  

  • Package fails, execute in sql*plus works

    SQL> execute toa.toa_security.change_password('testuser','testpassword'); ALTER USER testuser IDENTIFIED BY testpassword BEGIN toa.toa_security.change_password('testuser','testpassword'); END; ERROR at line 1: ORA-01031: insufficient privileges ORA-0

  • JMStudio won't play .avi files - mpeg-2 works fine

    Why doesn't JMStudio play .avi files? A small application that I created with JMF 2.1.1 has the same trouble. My .avi files can be played successfully with mediaplayer and also zoom player but JMStudio chokes on them. Why? I want to create a two-pane

  • Read Table with condition

    Hi, can i write a Read table like for example, read table itab into wa_itab with key matnr ne '4'. as its giving me an error. can suggest any other way to write the Read Table statement. Thanks in advance. Robert