Is there a method for adding a character to a string?

Hello,
is there a String method to add a Char to a String given the character number on the string?
EXAMPLE:
String text = "hello world"
I'd like to add a comma after the the 'o' (4th character) so I that text reads: "hello, world"
is there something like:
text.addChar(Char, position in string) ?

avanrotciv wrote:
Looce wrote:
Strings are not modifiable. However, if you make a StringBuffer out of it, you can use its insert(index, String) or insert(index, char) method.This is what I was looking for Thanks.
Should Strings just be directly modifiables? what's the reason they are not?The terms that are usually used are mutable (aka modifiable) and immutable (not modifiable).
[_Why are Strings immutable?_|http://forums.sun.com/thread.jspa?threadID=5332008]

Similar Messages

  • Is there a method for counting words?

    Hi!
    Is there a method for counting words?
    How do I read specific data ( row, column ) out of an array?
    Thx
    Lebite

    There's could be a better way, but this is how I would do it:
            String[][] myArray = { {"Blah Blah Blah"},
                                   {"Blah Blah Blah"},
                                   {"Blah Blah Blah"} };
            int tokens = 0;
            for(int i = 0; i < myArray.length; i++)
                for(int j = 0; j < myArray.length; j++)
    StringTokenizer st = new StringTokenizer(myArray[i][j]);
    tokens += st.countTokens();
    System.out.println(tokens);

  • Methods for adding DBL click event in ALV

    Methods for adding DBL click event in ALV

    Hi Jagrut,
      If you are using CL_GUI_ALV_GRID class to display ALV report and want to add
      double clicking functionality to ALV need to handle event DOUBLE_CLICK
      in your local class.
      See the below code how you define it.
    *===============================================================
    * LOCAL CLASSES: Definition
    *===============================================================
    CLASS LCL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
    * § 2. Define a method for each print event you need.
        METHODS:
        TOP_OF_PAGE FOR EVENT TOP_OF_PAGE
                             OF CL_GUI_ALV_GRID
                             IMPORTING E_DYNDOC_ID,
        DOUBLE_CLICK FOR EVENT DOUBLE_CLICK
                             OF CL_GUI_ALV_GRID
                             importing E_ROW.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *===============================================================
    * LOCAL CLASSES: Implementation
    *===============================================================
    * class c_event_receiver (Implementation)
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD TOP_OF_PAGE.
    * Top-of-page event
        PERFORM EVENT_TOP_OF_PAGE USING G_DYNDOC_ID.
      ENDMETHOD.                            "top_of_page
      METHOD DOUBLE_CLICK.
    * Top-of-page event
        PERFORM list using e_row.
      ENDMETHOD.                            "DOUBLE_CLICK
      You also need to register the events.
      And also check the program BCALV_GRID_VERIFY.
    Hope this will help you.
    Thanks&Regards,
    Siri.

  • Is there a limit for adding universe restriction set

    Hi Experts
    Is there a limit for adding universe restriction set?
    Can i have more than 100 or 1000 universe restriction set?
    Thanks!

    Hi,
    There is no limit set.
    Look at this document too for some knowledge.
    [http://www.dataspace.com/Downloads/IA_Final_MD.pdf]
    Regards,
    Bashir Awan

  • Transaction code for adding new character

    hi ,
          i am new member of this group.I want to know the transaction code for adding a new character in BW.
           please help me.
    Thanks in advance,
    reena

    Hi reena,
    When you say "adding a new character in BW" you want to create a new characteristic (InfoObject) in BW or you want to add a new char to BW?
    Modeling in BW is done at tocde RSA1 & go to relevant tab on left screen (dataprovide, InfoObjects etc) & right click to create Objects.
    hope it helps
    regards
    VC

  • Is there a penalty for adding Text messaging onto an existing plan?

    If I purchased a calling plan without text messaging would there be any penalty for adding the text messaging options on afterwards?

    No, Verizon allows you to change your plan at any time without penalty.

  • Is there quick method for putting cloud songs on a new computer?

    Is there a quick method for putting cloud songs on a new computer?

    Setu iCloud on the new computer >  Apple - iCloud - Learn how to set up iCloud on all your devices

  • Clean Methods for adding HTML5 content to CP6?

    This seems to be a major missing piece of the mLearning wokflow. As far as I can tell the only viable methods for getting Hype/Edge/etc.. HTML5 animation content into a Captivate project are as follows:
    1. Convert animation to HTML5 compatible video file (not very slick and a file size hog, IMHO)
    2. Use a webpage widget to embed the animation from an external page (not a huge fan of third party dependencies)
    3. Add content after the fact using Dreamweaver or some other HTML editor (makes changes and revisions a multistep productivity nightmare)
    4. Use a beta tool that appears to have stalled out in development e.g, Lacuna (Brilliant name, BTW)
    Have any of the brilliant Captivate masters in this forum come up with any more favorable solutions? I seems so half baked that Adobe would allow CP6 to ship with "HTML5 support" but not allow HTML5 embeds. Am I completey missing something here?
    Cheers!
    -Ryan

    Thanks for the reply Jim. I have used your widgets in the past and I appreciate the work you have done. No ill will towards widget developers intended . I'm glad I didn't miss anything and this is truly the is the state of things.
    Seemed like sunch a simple thing to do, in concept, but in practice, not so much. Just the ability to add html code to a slide would be a major boon. (I agree about the current state of HTML5, but the most obvious application of this feature is for mobile devices where HTML5 support is far more widespread than the desktop segment)
    I was wondering though, with your experirnce in widget development: Would it be practical to create a simple widget that contains the animation and then place that?
    BTW, I have applied to beta that Lacuna app that you linked me too, but have heard nothing from the developers. Have you any insight as to the progress of that project?
    Thanks again,
    Ryan

  • No longer able to use previous method for adding tracks and orginizing my library :(

    I use to add a few mp3's to my library then sort the library by date added to see the just added tracks at the top [most recent] of that view, well that don't always work since itunes 11. Can anyone explain please? or even offer an alternate method? I know there is now a folder named "Automatically Add to iTunes" is it absolutely necessary that I use that folder? If it is that odd because not everyone is as gifted as I {NOT!} and they might not be able to locate the folder.
    thanks
    Fredy

    You can restore much of the look & feel of the previous version with these shortcuts:
    CTRL+B to turn on the menu bar.
    CTRL+S to turn on the sidebar (your device should be listed here as before).
    CTRL+/ to turn on the status bar.
    Click the magnifying glass top right and untick Search Entire Library to restore the old search behaviour.
    Use View > Hide <Media Kind> in the cloud or Edit > Preferences > Store anduntick Show iTunes in the cloud purchases to hide the cloud items. The second method eliminates the cloud status column (and may allow iTunes to start up quicker).
    Use the Songs view and enable (if necessary) the Date Added column, then sort in descending order. Alternatively you could use the Recently Added smart playlist to view your imports.
    tt2

  • Is there a method for actually rotating the co-ordinates of 2D shapes?

    Hallo
    I'm trying to create a Graphics2D-powered program that needs to include polygons that can rotate. Now, as far as I can tell, affinetransform's methods will only ever transform the co-ordinate system of the User Space. So, for example, a GeneralPath object's co-ordinates will not change at all. Its useful only for rotating the Graphics2D display, not the underlying object.
    But I want to actually transform the co-ordinates of the Shape - e.g. select a rotation point (the centroid) of a Shape, and get a new set of co-ordinates for its points that rotates it by x radians. This is because I'm not using it just for display - it will be used to check what points are inside it, and needs to stick to the sprite it's used by.
    Is there any way of doing this - using a Shape object persistently, and just moving it and rotating it? Or do I need to make a new one every time, with new co-ordinates? Will I need to write my own rotate function? (Doable, just basic trig, but I kinda hoped there'd be a method somewhere...!)
    Cheers...

    sorry, the 'would you mind' wasn't meant to sound
    snotty! its amazing how bad forums can be for getting
    feeling across. I meant to say something like 'oh
    hell, I can't see how to do this. I don't suppose you
    happen to have an example lying around the place, do
    you?'
    I'll give it a go...I sounded a bit harsh perhaps. Sorry.
    I only saw someone give an answer and a couple of minutes later a follow-up asking for "example code", which lead me to believe you did not do any research/googling on what was suggested. I now read your original post and saw that you already knew of the AffineTransform class.
    Anyway, when I want to see some classes "in action" I always go to http://www.exampledepot.com . It also has some snippets on how to use the AffineTransform class:
    http://www.google.com/custom?domains=exampledepot.com&q=AffineTransform&sa=Google+Search&sitesearch=exampledepot.com&client=pub-6001183370374757&forid=1&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1%3B&hl=en
    Good luck.

  • Is there a method of adding a privacy feature to one or more of my bookmarks?

    I would like to know if there is any way to password protect or add a privacy feature to certain of my bookmarks.

    You can put the photos on the iPad with the Camera Connection Kit from Apple, either from an SD card or camera's USB cable. Then, once the photos are on the iPad, you can organize them with SortShots. But the Description field is short.
    Other apps are available also.... You can search the apps store for more info.

  • What is the best method for adding non-domain contacts into the Lync address book without Exchange

    Hi All,
    I have a large number of standards based video endpoints who we can route calls to form Lync via a third party application/infrastructure device (oh the day when Microsoft offer this bridge facility out of the box - but that's another story). They are not in
    Active Directory (although I suppose I could add them as 'Contacts'), but wondered if there is a more preferred way to do this?
    Many Thanks
    Chris

    Hi Swinster,
    You should add them as Contacts to AD. All the information in Lync Address Book come from AD.
    The Address Book Server uses data provided by User Replicator to update the information that it initially obtains from the global address list (GAL). User Replicator writes the Active
    Directory Domain Services attributes for each user, contact, and group into the AbUserEntry table in the database and the Address Book Server syncs the user data from the database into files in the Address Book Server file store and into the Address Book database
    RTCab.
    Best regards,
    Eric

  • Is there a method for time jump / time skip rather...

    Hi all,
    I'm a new BT Vision user, and treying to ween myself off my beloved old PVR (Topflield TF5800).
    One of the most useful features on the Topfield was a Time Jump, set to the 4 colour buttons. I had mine set to Red +2 mins, Green + 1 min, Yellow +30 secs, Blue -10 secs
    As most ad breaks are 4 minutes, it was very quick to skip these on recorded programs, and much easier than using FF or RW.
    Is this possible with BT Vision?
    If not, is there any formal way to register feature requests?
    Thanks
    Solved!
    Go to Solution.

    The feature is already there.  You can FF and RW at varying speeds or you can skip forwards 30 seconds or back 7 seconds.  This is also available when using On Demand although there are no commercials in the On Demand content.  We use the 30 second skip a lot. You just use the >| button for 30 seconds forward and the |< button for 7 seconds back - these are next to the >> and << buttons respectively.
    The blue colour button is already tied up to search the TV Guide at any time and red button services can still be accessed when watching a programme on catch-up so they couldn't really be programmed as you describe.
    ---Remember to mark as 'solved' and give stars when you like a post---

  • Is there a shortcut for adding file extensions?

    I have an archive of over 15,000 images, all TIFF, JPEG and Photoshop images. None of them have file extensions. They were saved back when Mac did not use extensions. Now they will not open if I just double click on them... I must add the correct extension, then it opens fine.
    It will take me FOREVER to click on each one, type in the extension, then click "Add".
    Is there a script or shortcut to name all these old files? Or shareware?
    Or at the very LEAST is there a way to turn off that annoying dialog box to confirm that I want to add the extension?
    Thanks, any feedback will be appreciated.

    I have a whole lot of very old graphic files, and thought I would try Kappy's recommendation of Renamer4Mac, combined with a Spotlight search to see how speedily one could add extensions. So did a Spotlight search on a backup folder that contains many and varied sub-folders containing many and various images. To get the old pict files I hit command-F from the top level folder, selected that folder (WHY does search have "This Mac" as the default???), and for Kind I selected Other and typed:
    Adobe Photoshop PICT file
    in the blank field. It returned a list of 961 old pict files. Launched Renamer and told it to insert the text pct, at position 1 from left, suffix only. Then dragged a batch of the files from the search results window into the top pane of the Renamer window, clicked the Rename Files button, et voila'! The files were renamed (and no confirm dialog box).
    To figure out what to put in the Kind:Other field, just do a search on Kind:Images and note the different types. Thus, something that needed the psd extension would be Adobe Photoshop file, to find tifs, it would be TIFF image. You might have some "QuickDraw picture" as an image kind, they are pict files. Plain jpegs can be brought up with Kind: JPEG image, extension jpg. And so on.
    Francine
    Francine
    Schwieder

  • Is there any alternative for adding servlet name in Web.xml?

    Hi,
    I am new to Weblogic and I have an application(Ear file) which was developed
    in Websphere and I am trying to install in weblogic 8.1. I have installed my application
    in Websphere without adding servlet entries in Web.xml and it was working fine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead of adding each
    and every servlet entry in web.xml because my application has around 200 servlets
    Thanks&Regards,
    Gopi.

    Is Servlet servlet same as weblogic.servlet.ServletServlet?
    Deepak
    Rob Woollen <[email protected]> wrote:
    Yes, you could register weblogic.servlet.ServletServlet.
    -- Rob
    Gopi Krishna wrote:
    Hi,
    I am new to Weblogic and I have an application(Ear file) whichwas developed
    in Websphere and I am trying to install in weblogic 8.1. I have installedmy application
    in Websphere without adding servlet entries in Web.xml and it was workingfine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead ofadding each
    and every servlet entry in web.xml because my application has around200 servlets
    Thanks&Regards,
    Gopi.

Maybe you are looking for

  • Crystal report layout printing issue

    Hi Experts I have a bit of an urgent issue which I can't seem to solve. I have created a print spec using crystal reports 2008 sp3.  I am trying to print it using an epsom dot matrix printer which is brand new. When I print from crystal reports itsel

  • Can't download photoshop and dreamweaver in cloud. Says Installed, but I don't have it

    So a while ago I was using the trial version of photoshop and dreamweaver. I decided to pay for cloud to access these programs but I uninstalled the programs first. Now when I click the download I can't install either one because it says installed ne

  • Error when running extract paramfile on windows

    can somone please tell me what uncognized parameter is? E:\GGS>extract.exe PARAMFILE dirprm\inext.prm REPORTFILE dirrpt\inext.rpt Oracle GoldenGate Capture for SQL Server Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230 Windows x64 (optimi

  • "tnsnames.ora" file & ODBC driver

    It seems ODBC drivers do not need TNS listeners! I need to find out how ODBC drivers determine the path of "tnsnames.ora" file! (I have many Oracle installations on my machine.) null

  • Hosting Multiple SSL Sites on Separate IP Addresses

    Hosting Multiple SSL Sites on Separate IP Addresses I currently have a web server (XServe) hosting a number of different sites from its main IP address on port 80 using Apache 1.3. This has been working great, the ServerAdmin GUI has been pretty good