How to replace substring with a char

Hi,
Suppose i have
String x = "abcdabcd";
i need to replace string from index 1 till index 2 ( i mean the initial bc) with "T" so that x becomes
x = "aTdabcd";
is there any easier way or direct function in Java 1.3 to do that. i was checking sun website but didnt find any.
Plz guide me. thanks

public String replaceSubstring(String string, int start, int end, char c) {
return string.substring(1, start) + String.valueOf(c) + string.substring(end) ;
}Not sure if its exactly right but you get the idea (cant be arsed checking it). Honestly, try to come up with something before asking

Similar Messages

  • How to replace MobileMe with ICloud on my Imac?

    how to replace MobileMe with ICloud on my Imac? pleae help.  Other devices (Ipad and Iphone) are Iclouded but I can't change MobileMe in my system preferences on IMac (10.6.8)
    Sylwia

    You need to upgrade the computer's OS. Open the Mac App Store and try downloading Mavericks. If you get told it's incompatible, choose About this Mac from the Apple menu, check if the computer has at least a Xeon or Core 2 Duo(not Core Duo) CPU and 2GB of RAM, and if it does, click here and order a download code for Lion 10.7.
    Back up your data before upgrading. Mac OS X 10.7 and newer don't support PowerPC programs such as versions of Microsoft Office prior to 2008.
    (103507)

  • 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...

  • How to replace number with flexible length

    Hi..
    Could somebody help me, how to replace any number start with more than 2 digits of "0" become 2 digits "0" only. As example:-
    Sample Result
    123456789 => 123456789
    0123456789 => 0123456789
    00123456789 => 00123456789
    000123456789 => 00123456789
    0000123456789 => 00123456789
    00000123456789 => 00123456789
    Thank you,
    Baharin

    Or - to handle the situation when '00' is also in between the word:
    SQL> with t as (
    select '12300456789' str from dual union
    select '0123456789' from dual union 
    select '00123456789' from dual union
    select '000123456789' from dual union
    select '0000123456789' from dual union
    select '00000123456789' from dual
    select str,
            decode(substr(str,1,2),'00', '00' || ltrim(str,'0'),str) new_str
    from   t
    STR            NEW_STR        
    00000123456789 00123456789    
    0000123456789  00123456789    
    000123456789   00123456789    
    00123456789    00123456789    
    0123456789     0123456789     
    12300456789    12300456789    
    6 rows selected.

  • How to replace sapdba with brtools after upgrade database to 10.2

    All,
        I have update our database to oracle 10.2,my brtools version is 7.0 now ,
    but can't run analyze table and dbcheck in db13,
    seems to still use SQLDBA when run analyze table and dbcheck.
    please refer to the below informations.
    Detail log:                    0810080300.aly
    *****                 SAPDBA - SAP Database Administration for ORACLE     *****
    SAPDBA V6.10    Analyze tables
    SAPDBA release: 6.10
    Patch level   : 1
    Patch date    : 2001-05-25
    ORACLE_SID    : PRD
    ORACLE_HOME   : /oracle/PRD/102_64
    ORACLE VERSION: 10.2.0.2.0
    Database state: 'open'
    SAPPRD       : 46C
    SAPDBA DB USER:  (-u option)
    OS login user : prdadm
    OS eff.  user : prdadm
    SYSDBA   priv.: not checked
    SYSOPER  priv.: not checked
    Command line  : sapdba -u / -analyze DBSTATCO
    HOST NAME     : sapprd1
    OS SYSTEM     : HP-UX
    OS RELEASE    : B.11.31
    OS VERSION    : U
    MACHINE       : ia64
    Log file      : '/oracle/PRD/sapcheck/0810080300.aly'
    Log start date: '2008-10-08'
    Log start time: '03.00.09'
    ----- Start of deferred log ---
    SAPDBA: Can't find the executable for SQLDBA/SVRMGR. Please, install one of
            them or enter one of them in the SAPDBA profile (parameter
            sqldba_path).
            (2008-10-08 03.00.06)
    SAPDBA: Error - running temporary sql script
            '/oracle/PRD/sapreorg/dbacmd.sql' with contents:
    CONNECT /******** AS SYSDBA
    SAPDBA: Couldn't check SYSDBA privilege.
    SAPDBA: Can't find the executable for SQLDBA/SVRMGR. Please, install one of
            them or enter one of them in the SAPDBA profile (parameter
            sqldba_path).
            (2008-10-08 03.00.06)
    SAPDBA: Error - running temporary sql script
            '/oracle/PRD/sapreorg/dbacmd.sql' with contents:
    CONNECT /******** AS SYSOPER
    SAPDBA: Couldn't check SYSOPER privilege.
    ----- End of deferred log ---
    Analyze parameters:
    Object: All tables in table DBSTATC ( for DB optimization run )
    Method: E ( Default )
    Option: P10 ( Default )
    Time frame: 100 hours
    Refresh   : All objects
    Option: DBSTATCO ( for the DB optimizer: Tables with Flag DBSTATC-TOBDO = 'X' )
    ** Refresh Statistics according control table DBSTATC **
    Total Number of Tables in DBSTATC to be analyzed:                           170
    Number of Tables with forced statistics update (ACTIV = 'U'):                 0
    SAPDBA: SELECT USER# FROM SYS.USER$ WHERE NAME='SAPPRD'
    ORA-00942: table or view does not exist
               (2008-10-08 03.00.09)
    SAPDBA: Error - getting size of segment 'SAPPRD.D010INC'
    SAPDBA: Error - during table analysis - table name: ->D010INC
    SAPDBA: No tables analyzed ( No entries in DBSTATC with TOBDO = X or errors ).
    SAPDBA: 0 table(s) out of 170 was (were) analyzed
            Difference may be due to:
               - Statistics not allowed ( see DBSTATC in CCMS )
               - Tables do not exist on database and were skipped
    Detailed summary of Step 1:
    Number of Tables that needed new statistics according to DBSTATC:             1
    Number of Tables marked in DBSTATC, but non-existent on the Database:         0
    Number of Tables where the statistics flag was resetted:                      0
    ******* Creating statistics for all tables without optimizer statistics *******
    SAPDBA: Using control table DBSTATC
            for taking optimizer settings into account
    SAPDBA: 0 table(s) without statistics were found.
    SAPDBA: 0 table(s) ( out of 0 ) was (were) analyzed/refreshed.
            0 table(s) was (were) explicitely excluded or pool/cluster table(s).
    SAPDBA: 0 index(es) without statistics was (were) found.
    SAPDBA: 0 index(es) ( out of 0 ) was (were) analyzed/refreshed.
            0 index(es) was (were) explicitely excluded or pool/cluster indexe(s).
    SAPDBA: 157 table statistics from 157 tables were dropped.
            They are either explicitely excluded in DBSTATC,
            or R/3 Pool- or Cluster- tables
            that must not have CBO Statistics
    SAPDBA: The whole operation took 10 sec
    SAPDBA: Step 1 was finished unsuccessfully
    SAPDBA: Step 2 was finished successfully
    Date:   2008-10-08
    Time:   03.00.19
    *********************** End of SAPDBA statistics report ****************
    How to replace sapdba by brtools?please give me support,thanks.
    Best Regards,
    Mr.chen

    >     I have update our database to oracle 10.2,my brtools version is 7.0 now ,
    > but can't run analyze table and dbcheck in db13,
    > seems to still use SQLDBA when run analyze table and dbcheck.
    Yes, it does so, because somebody forgot to upgrade the BASIS SP as well...
    What BASIS SP are you using?
    regards
    Lars

  • How to replace numbers with text in tax return pdf using Adobe Acrobat X Pro

    How do I replace numbers with text in tax return pdf using Adobe Acrobat X Pro? The tax return was created using CCH software. Thanks for your review.

    Thanks Bill for your quick reply. CCH software is one of the major
    suppliers of tax return software. I found an internal source that helped me
    make the changes from numbers to text i.e. "$123,456" to "See Schedule O".
    I am not sure if I am working in form or final text. Thanks again! Kelly

  • How to do substring with Expression Builder

    Hi,
    I only execute a substring with Expression Builder, this is possible?
    thanx

    Hi!
    With Expression Builder it is not possible as the EL by default does not have such function.
    But you may:
    1. Use JSTL 1.2 functions like "${fn:trim(' MYSTRING '}"
    2. Write your own function and TagLib - see on net
    Also, you may write a custom Map implementation and expose it in some backing bean to make it available in EL without need to create TagLib (as #{mybean.trim[' some string  ']"). But this way is much complex if you need more than singe parameter for your function...
    Regards,
    PaKo

  • How To Replace LOVs With Buttons

    Hi all,
    can someone please advise if it is possible to replace LOVs with Buttons? Customer has a requirement to replace the LOVs with buttons in Compensation Manager to approve/reject the paysheet. This is for R12.1.3.
    Many thanks
    Amanda

    Hi,
    1) First create a new region of LOV type.
    2) Then under flowlayout region, add lov action button. On its 'External LOV' property, give the path of lov region created in step1.
    3) Right click on 'lov action button' to add 'lovActionMappings'.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to replace #MISSING with 0 in Hyperion Financial Report

    I am developing report in Hyperion Financial Reporting Studio. The report shows #MISSING for no data and does not look nice. I want to replace #MISSING with 0 (Like I did in SmartVIEW). However, I could not find a way to do that in Financial Reporting Studio.
    Thank you for any help in advance.

    To replace no data (#MISSING) in cells, type a value in the No Data text box.
    Refer: Page 191 of http://download.oracle.com/docs/cd/E12825_01/epm.111/fr_user.pdf
    HTH-
    Jasmine.

  • My ipad has been burnout today while charging it...Today it has been totally burnt and its screen got cracked from middle and charger got so tempered as hot burning rod. kindly suggest how to replace it with new as my ipad is in warranty period..? Rajiv.

    How to replace my burnt ipad while charging it ?????
    plz. HELP ????
    its warranty is till august 18, 2014.

    This is a user-to-user forum here.  You need to talk to Apple Support directly.
    http://www.apple.com/support/contact/

  • How to replace "." with "," and "," with "." in a quantity field

    HI All,
    I wanna display the field mard-labst in the alv report. Based on the user default settings  2,454.500 is displayed as 2.454,500. Without changing the user default settings how can i display the decimal position correctly..Any help would be highly appreciated.
    Best regards,
    Subhakar Ramineni

    Hi...Subhakar..
    i got ur prob...this is the solution...just paste it and go through it...
    Report  YH642_TEST.
    TABLES:
      mard.
      DATA : W_mard_labst type p decimals 3,
              w_dt1(18).
    data:
      W_N TYPE I.
    SELECT SINGLE * FROM MARD INTO MARD WHERE  LABST = '10000.00'.
      WRITE: mard-labst .
      W_mard_labst = mard-labst.
      WRITE:/ W_mard_labst .
      w_dt1 = w_mard_labst .
      write W_mard_labst to w_dt1.
    W_N = STRLEN( W_DT1 ).
    W_N = W_N - 4.
    REPLACE ALL OCCURRENCES OF ',' IN W_DT1 WITH '.' .
    REPLACE ALL OCCURRENCES OF '.'
    IN SECTION OFFSET W_N LENGTH 4 OF W_DT1 WITH ','.
    WRITE: / W_DT1.

  • How to replace IMessage with Ichat

    I have recently updates to os x mountain Lion, and Ichat has been replaced. I hate IMessage how do i get back Ichat.

    HI,
    The iChat App is specific to each Update within an OS X version run.
    Messages is the version on Mountain Lion.
    At OS X 10.8.2 it became version 7.0.1
    That is to say that version 7.0 lasted for OS X 10.8 and 10.8.1
    You can get Messages to look somewhat iChat like.
    Lets say you have AIM (or AIM valid) Names and some Jabber IDs (including GoogleTalk or Facebook)
    Either Add them in Messages the same way you would have in iChat (Use the Plus icon in Preferences > Accounts) or by activating the choice for Messages in System Preferences > Mail, Contacts and Calendars for any ID/Name you use in Mail or elsewhere.
    This will give you a list of Accounts in the Messages Menu > Preferences > Accounts including the iMessages one and the Bonjour one.
    If all are Enabled then the Window menu will now show Buddies (CMD + 1) in addition to the Messages (CMD +0)
    If you use this you will see a combined Buddy List.
    The can be unlinked by going to Messages > Preferences > General Section and Unticking the line that talks about "gather all accounts in to one list"  (actually it is only Buddy lists Account and does not include the iMessages account)
    The Window Menu will now list as many Buddy lists as you have Accounts (Less the iMessage one and any that are not logged in.)
    Each will have it's own keystrokes listed.
    The title of the Buddy list and the Name in the Window Menu is dependant on the Description Field in the accounts pane.
    Example Pic of the Accounts Prefs pane with Buddy lists
    The iMessages account does not have to be active.
    The main draw back is the Messages window itself with it's dual purpose Tabbed Chat window and interface to start Chats without using the Buddy lists.
    Double clicking a chat will open it in it's own window.
    9:39 PM      Thursday; January 24, 2013
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • 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.

  • How to replace lvlib with lvlibp programmatically

    Hello,
    in the project explorer there is the possibility to do a "Replace with a packed library" from the context menu.
    How can I do this programmatically?
    Thank you.
    Christian

    I have a specific use case for this, and was wondering if anyone figured out how to do it. My Google search does not turn up much other than this thread.
    My use case: I have  main code branch that is not ready for LVLIPB's because the architecture is not 100% complete. However, we are release an Executable build on that relies on a pluggable actor framework architecture. Currently I manually branch the code, replace all LVLIB's with LVLIBP's then build additional LVLIPB's from that code and go back and replace the LVLIB's. At that point my code is now ready to be build as an executable with plug-ins. This process takes about 1-2 hrs to complete. This process works and works well repeatedly, it is just time consuming due to the relining. If I could just off load it to another PC that would enable to me to make additional bug fixes or work other issues in the main code branch. Currently we build about once a day or two for final release testing.
    Any help in to script this would be much appreciated.
    Thanks!
    Brian G. Shea
    Systems Integrator / Certified LabVIEW Architect
    National Technical System, Inc.

  • How to replace Consolekit with systemd-loginctl

    Is systemd's new multiseat ready to replace consolekit?
    And if, how can I achieve that?
    My Background:
    - I use systemd as my init system
    - login into a getty
    - which create a new X session with startx through a login script
    I have had a hard time before I had the right setup to supervise everything with *ck-launch-session* and  *dbus-launch* (order matters).
    And sometimes without a reason, something breaks and I'm not allowed to mount USB drives or shutdown as a user without a reboot.
    Last edited by Mic92 (2012-06-01 13:36:59)

    I do have a session:
    ┌─[jente @ lappy ~] 21:48:14
    └─■ loginctl
    SESSION UID USER SEAT
    1 1000 jente seat0
    1 sessions listed.
    I start Udiskie through .xinitrc, like so:
    if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
    eval `dbus-launch --sh-syntax --exit-with-session`
    fi
    exec bash -c "udiskie & $HOME/.bin/dwm_start"
    With .bin/dwm_start:
    #!/bin/bash
    while true; do
    dwm >/dev/null 2>&1
    done
    EDIT: Here's udiskie's output when I plug in my external HD:
    attempting to mount device /org/freedesktop/UDisks/devices/sdb2 (ext4:[])
    failed to mount device /org/freedesktop/UDisks/devices/sdb2: org.freedesktop.UDisks.Error.PermissionDenied: Not Authorized
    attempting to mount device /org/freedesktop/UDisks/devices/sdb1 (ntfs:[])
    failed to mount device /org/freedesktop/UDisks/devices/sdb1: org.freedesktop.UDisks.Error.PermissionDenied: Not Authorized
    EDIT2:
    Changing my .xinitrc to the following didn't help either:
    udiskie &
    exec $HOME/.bin/dwm_start
    Also, I found out I have to enter my root password to shutdown/reboot, whereas I didn't have to before.
    Last edited by Unia (2012-09-05 19:55:23)

Maybe you are looking for

  • CATS report  RCATSP01:  Problem with statement IMPORT FROM MEMORY ID.

    Hi Guys, I am trying to create a Z custom report using SAP template RCATSP01. In template report there is an IMPORT statement as below. IMPORT icatsd        catsfields        fieldtab FROM MEMORY ID 'LR2'. When I run the report in debug mode, I found

  • Growing lines in Keynote 09

    hi, I like to connect two items with a growing line or with a line that change its color from one side to the other. How can it be done? Thanks and greetings Eva

  • Preview on device from folio overlays panel is fuzzy

    I'm new to DPS so I'm sure there's a setting somewhere that I haven't checked, but why is the text fuzzy on my iPad when I preview my article? I have a retina iPad, my document is 1024x768, and I'm using the "Preview on XYZ iPad" function at the bott

  • Unicode error in statement Describe Field

    Hi, There is a statement in my program which is giving Unicode error. DESCRIBE FIELD t_mara-mfrpn LENGTH len. Here t_mara is internal table with header line. Unicode error which I am getting is 'In Unicode, Describe Length can only be used in Byte mo

  • Transport of Customizing Tables

    Hi experts, there are possibilities of customizing content tables in a transport to write. Thanks Dirk