Execute method to a string written in another string

Hi all,
I need help...!!
I must call a function/method on a string written in another string like this:
String s1 = "GR0000";
String s2 = "substring(0,s1.length()-2)";
I want execute
s1.substring(0,s1.length()-2)
from s1,s2, how can i do it?
Thank you in advice!!!

Hi all,
I need help...!!
I must call a function/method on a string written in
another string like this:
String s1 = "GR0000";
String s2 = "substring(0,s1.length()-2)";
I want execute
s1.substring(0,s1.length()-2)
from s1,s2, how can i do it?
Thank you in advice!!!Advance.
I assume that you want the equivalent of a javascript eval() function ?
Seek for it not in java! What you want is a script interpreter. What you could do is wrap the string in a string representing a java class, write that string to disk as a java file, compile it, have the ClassLoader suck it up and execute it. Viola. The jsp-way; the hard way, but the only way.
If I'm wrong about your intentions, then tell me. I can't seem to figure it out totally. But good luck anyway.

Similar Messages

  • How to concatenat​e a string in between another string

    hi,
    i wanted to concatenate 2 strings. i have two strings, s1 and s2. i wanted to concatenate s2 in between the text at specific place in s1, instead at the end. how do i do this?
    please help.
    thanks sunal

    aeastet wrote:
    Yamaeda wrote:
    aeastet wrote:
    How do you know where to insert the text from S2 into S1?
    That wasn't the question. For now.
    /Y
    No but it will probably make a difference on how you do it.
    I was ready to bet some pennies on what the next question would be ... but it hasn't come yet.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • How to call inner class method in one java file from another java file?

    hello guyz, i m tryin to access an inner class method defined in one class from another class... i m posting the code too wit error. plz help me out.
    // test1.java
    public class test1
         public test1()
              test t = new test();
         public class test
              test()
              public int geti()
                   int i=10;
                   return i;
    // test2.java
    class test2
         public static void main(String[] args)
              test1 t1 = new test1();
              System.out.println(t1.t.i);
    i m getting error as
    test2.java:7: cannot resolve symbol
    symbol : variable t
    location: class test1
              System.out.println(t1.t.geti());
    ^

    There are various ways to define and use nested classes. Here is a common pattern. The inner class is private but implements an interface visible to the client. The enclosing class provides a factory method to create instances of the inner class.
    interface I {
        void method();
    class Outer {
        private String name;
        public Outer(String name) {
            this.name = name;
        public I createInner() {
            return new Inner();
        private class Inner implements I {
            public void method() {
                System.out.format("Enclosing object's name is %s%n", name);
    public class Demo {
        public static void main(String[] args) {
            Outer outer = new Outer("Otto");
            I junior = outer.createInner();
            junior.method();
    }

  • Using value selected in selectOneChoice as variable for execute method

    I have already created data controls for the session bean method so I can drag and drop on to the jsp. This works fine when entering the data into the input text fields but I really need the first value to come from an initial page and the second value to come from the dropdown. I just don't know how to get the value or how to connect it to the button for execution.
    The method takes two values
    value 1, org is passed in (how do I pass from another page? I will actually have the render for this input field set to false so it does not display)
    value 2, typeId from a selectonechoice drop-down list (how do I manipulate the soc to pass the information? Currently it looks as if it is just passing the elementAt number, I need get the actual value for the item selected. Where can I retrieve it?)
    I have a button ready to execute the method on the session bean which should take these values. (of course the inputvalue for the soc was not typeId but I changed it. The values for the soc are actually coming from another method performed earlier.)
    This is what I have so far:
    I have my input text field waiting on info to be populated from the previous page (currently I manually entered it)
    I have my selectonechoice populated
    A button with the execute method already set (b/c I initially used the drag-drop functionality to test my method)
    Forgive me for repeating myself so much.
    Thanks!

    Passing a value between pages:
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_lifecycle.htm#BABIHDAA
    Getting a value from a list item:
    http://www.oracle.com/technology/products/jdev/tips/mills/listvalue/listbindingvalue.html
    http://blogs.oracle.com/shay/2009/11/getting_the_value_from_a_selec.html

  • HT4972 Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written: To complete the unlock, simply  1 . Open iTunes o

    Good afternoon! I addressed in the AT&T company with a question about untying of a sim card of AT&T from my iPhone, all of them made Iphone now is unlocked, I executed all points which were written:
    To complete the unlock, simply
    1 . Open iTunes on your Mac or PC and verify that you have Internet connectivity.
    2 . Ensure a SIM card is inserted into your iPhone.
    3 . Connect your iPhone using the dock connector to USB cable that came with your iPhone.
    4 . Backup and restore your iPhone using iTunes. For information on backup and restore, please visit http://support.apple.com/kb/HT1414.
    5 . After restoring, your iPhone will be unlocked.
    Additional information on unlocking can be found at http://support.apple.com/kb/TS3198
    I made everything as well as was written, but on completion of the ios 6.1.3 installation the iPhone asks to be activated through wifi or through a wire to the computer.
    I connected Iphone to the computer and the text takes off: (Were sorry, we are unable to continue with your activation at this time. Please TR again later, or contact customer care! )
    how to me to activate my iPhone?
    I hope for your help....

    Hey APPLELovestory,
    We have an article that goes over troubleshooting iPhone activation issues here:
    iPhone: Troubleshooting activation issues
    http://support.apple.com/kb/TS3424
    Perform the following steps:
    Restart the iPhone.
    Try another means of reaching the activation server and attempt to activate.
    Try connecting to Wi-Fi if you're unable to activate using a cellular data connection.
    Try connecting to iTunes if you're unable to activate using Wi-Fi.
    Restore the iPhone.
    If you receive an alert message when you attempt to activate your iPhone, try to place the iPhone in recovery mode and perform a restore. If you're still unable to complete the setup assistant due to an activation error, contact Apple for assistance.
    Hope that helps,
    David

  • How to replace a particular striing with another string in jtextpane

    how to get replace a particular string with another string of a jtextpane without taking the text in a variable using getText() method .

    Thanks for your answer,
    "relevant object" means for you datasources, transfer rules and transformations ?
    With the grouping option "Save for system copy" I can't take easily all datasources, and others objects
    Will I have to pick all object one by one ?
    What would be the adjustement in table RSLOGSYSMAP ? For the moment it's empty.
    Regards
    Guillaume P.

  • Replacing a special character in a string with another string

    Hi
    I need to replace a special character in a string with another string.
    Say there is a string -  "abc's def's are alphabets"
    and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
    "abc&apos&s def&apos&s are alphabets" .
    Kindly let me know how this requirement can be met.
    Regards
    Sukumari

    REPLACE
    Syntax Forms
    Pattern-based replacement
    1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
    pattern
              IN [section_of] dobj WITH new
              [IN {BYTE|CHARACTER} MODE]
              [{RESPECTING|IGNORING} CASE]
              [REPLACEMENT COUNT rcnt]
              { {[REPLACEMENT OFFSET roff]
                 [REPLACEMENT LENGTH rlen]}
              | [RESULTS result_tab|result_wa] }.
    Position-based replacement
    2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                      [IN {BYTE|CHARACTER} MODE].
    Effect
    This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
    When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
    In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
    System fields
    sy-subrc Meaning
    0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
    2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
    4 The subsequence in sub_string was not found in dobj in the pattern-based search.
    8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
    Note
    These forms of the statement REPLACE replace the following obsolete form:
    REPLACE sub_string WITH
    Syntax
    REPLACE sub_string WITH new INTO dobj
            [IN {BYTE|CHARACTER} MODE]
            [LENGTH len].
    Extras:
    1. ... IN {BYTE|CHARACTER} MODE
    2. ... LENGTH len
    Effect
    This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
    The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
    During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
    System Fields
    sy-subrc Meaning
    0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
    4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
    Note
    This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
    Addition 1
    ... IN {BYTE|CHARACTER} MODE
    Effect
    The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
    Addition 2
    ... LENGTH len
    Effect
    If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
    If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
    Example
    After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
    DATA:   text1      TYPE string       VALUE 'I know you know',
            text2(18)  TYPE c LENGTH 18  VALUE 'I know you know',
            sub_string TYPE string       VALUE 'know',
            new        TYPE string       VALUE 'should know that'.
    REPLACE sub_string WITH new INTO text1.
    REPLACE sub_string WITH new INTO text2.

  • Execute Method must not return a resultSet

    Hi.
    I am using DataModifyQuery to insert a record in MS SQL. On that Table there is one trigger defined whcih in turn insert data into some other table. in case there is any error the trigger return a error message.
    When i execute the Sql with DataModifyQuery and there is a error return from the trigger then Toplink gives me a error message.
    Execute Method must not return a resultSet
    how can i over come this sistuation.
    Thanks.

    Nadir wrote:
    I was lost. Right, there was no return statement. Below works now
    public String getIPAddress(){
    String hostip = "";
    try {
    hostip = InetAddress.getLocalHost().getHostAddress();
    System.out.println("ip is "+hostip);
    } catch (UnknownHostException e) {
    hostip = e.getMessage();
    return hostip;
    -----It compiles. I wouldn't say it works. If I call a method getIPAddress(), I expect the String I get back to be an IP address. I don't want to have to parse it to determine that it's not an error message. That defeats the whole purpose of the exception mechanism. If that method can't get the IP address, it should throw an exception. In this case, there's no reason to catch the exception; just let it propagate up out of that method.
    Beginners often seem to think that exceptions are something that just arose on their own out of the language, and the designers had to add try/catch in order to be able to stop them from preventing our code executing. That's not the case. They were deliberately added to the language as a better way of indicating an error than checking return values at every step.

  • Search given string array and replace with another string array using Regex

    Hi All,
    I want to search the given string array and replace with another string array using regex in java
    for example,
    String news = "If you wish to search for any of these characters, they must be preceded by the character to be interpreted"
    String fromValue[] = {"you", "search", "for", "any"}
    String toValue[] = {"me", "dont search", "never", "trip"}
    so the string "you" needs to be converted to "me" i.e you --> me. Similarly
    you --> me
    search --> don't search
    for --> never
    any --> trip
    I want a SINGLE Regular Expression with search and replaces and returns a SINGLE String after replacing all.
    I don't like to iterate one by one and applying regex for each from and to value. Instead i want to iterate the array and form a SINGLE Regulare expression and use to replace the contents of the Entire String.
    One Single regular expression which matches the pattern and solve the issue.
    the output should be as:
    If me wish to don't search never trip etc...,
    Please help me to resolve this.
    Thanks In Advance,
    Kathir

    As stated, no, it can't be done. But that doesn't mean you have to make a separate pass over the input for each word you want to replace. You can employ a regex that matches any word, then use the lower-level Matcher methods to replace the word or not depending on what was matched. Here's an example: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final List<String> oldWords =
          Arrays.asList("you", "search", "for", "any");
      static final List<String> newWords =
          Arrays.asList("me", "dont search", "never", "trip");
      public static void main(String[] args) throws Exception
        String str = "If you wish to search for any of these characters, "
            + "they must be preceded by the character to be interpreted";
        System.out.println(doReplace(str));
      public static String doReplace(String str)
        Pattern p = Pattern.compile("\\b\\w+\\b");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        while (m.find())
          int pos = oldWords.indexOf(m.group());
          if (pos > -1)
            m.appendReplacement(sb, "");
            sb.append(newWords.get(pos));
        m.appendTail(sb);
        return sb.toString();
    } This is just a demonstration of the technique; a real-world solution would require a more complicated regex, and I would probably use a Map instead of the two Lists (or arrays).

  • Parsing String Oject into another JFrame page

    Hi,
    Can I know if it is possible to parse a string object into another JFrame page that I had created.
    Say i created a string object called obj, i want to pass the value of the string object "obj" to another JFrame page. How can it be done?
    String obj= new String();
              obj=table.getValueAt(table.getSelectedRow(),table.getSelectedColumn()).toString();Next, can i know how tocheck if a connection exist?
    Like i wann connect to a FTP server and i would like to check in the first place if the connection exist/available.
    appreciate all help.
    thanks.

    Essentially the same problem as solved here: http://forum.java.sun.com/thread.jspa?threadID=698985
    You should keep in mind that there is a difference between static and non-static thingies...
    * what goes into the class and what goes into the objects?
    ...and you should also keep in mind that Java is case sensitive and Java programmers (well, almost everyone) follow the same naming conventions :
    * use Capital letter for classes
    * finals all capital (with undercores denoting words)
    * everything else have lowercase letter
    * capitalize first character whenever "a new word" comes along
    You will keep bashing your head against a wall with minor problems until you figure it out. A "Java naming-ized" version of your (presumed) code might act as some kind of starting point?
    public class Search extends JFrame {
      //instance/object thingies -----------------
      private String aString;            // a instance field (unique for this instance)
      public Search(String anArgument) { // the Search constructor, with an argument
        aString = anArgument;          //do something with the argument ...
      //class thingies -----------------
      public static String str= "Some string";  // a static field (shared by all instances)
      public static void main(String[] args) {  // the main method is static...
        Search frame = new Search(str);      // create the Search object/frame, passing a parameter
        frame.setVisible(true);     
    }

  • MDMJavaAPI: Execute() method is not running.

    Hi Gurus,
    I am trying to delete the repository using MDMJavaAPI.
    Here is the whole code for deleting repository.
    =============================================import com.sap.mdm.commands.AuthenticateRepositorySessionCommand;
    import com.sap.mdm.commands.CommandException;
    import com.sap.mdm.commands.CreateRepositorySessionCommand;
    import com.sap.mdm.commands.DestroySessionCommand;
    import com.sap.mdm.net.ConnectionException;
    import com.sap.mdm.net.ConnectionPool;
    import com.sap.mdm.net.ConnectionPoolFactory;
    import com.sap.mdm.repository.RepositoryStatus;
    import com.sap.mdm.repository.commands.DeleteRepositoryCommand;
    import com.sap.mdm.repository.commands.GetRepositoryStatusCommand;
    import com.sap.mdm.server.DBMSType;
    import com.sap.mdm.server.RepositoryIdentifier;
    @author tarunsha
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class TestDeleteRepository {
                        public static final int STATE_NOT_CONNECTED = 0;
                        public static final int STATE_CONNECTED = 1;
                        public static int state = STATE_NOT_CONNECTED;
                        public static ConnectionPool simpleConnection;
                        public static RepositoryIdentifier repIdentifier;
                        public static String session;
                        public static String connection = "ntbomsap14";
                        public static String repository = "Test_JavaMDMapi_Tarun";
                        public static DBMSType dbmsType = DBMSType.MS_SQL;
                       public static void main(String[] args)throws CommandException, ConnectionException {
                       //Creating Connection.
                       simpleConnection = ConnectionPoolFactory.getInstance(connection);     
                       //Establishing connection with Repository.
                       repIdentifier = new RepositoryIdentifier("Test_JavaMDMapi_Tarun", connection, dbmsType);
                       //Creation Repository Session.
                       CreateRepositorySessionCommand createRepositorySessionCmd = new CreateRepositorySessionCommand(simpleConnection);
                       createRepositorySessionCmd.setRepositoryIdentifier(repIdentifier);
                       createRepositorySessionCmd.execute();
                       System.out.println("Create Repository Session Cmd is Executed.......");
                       session = createRepositorySessionCmd.getRepositorySession();
                       System.out.println("STATE_CONNECTION_ESTABLISHED.....");
                       AuthenticateRepositorySessionCommand authenticateRepositorySessionCmd = new AuthenticateRepositorySessionCommand(simpleConnection);
                       authenticateRepositorySessionCmd.setSession(session);
                       authenticateRepositorySessionCmd.setUserName("Admin");
                       authenticateRepositorySessionCmd.setUserPassword("");
                       authenticateRepositorySessionCmd.execute();
                        session = authenticateRepositorySessionCmd.getSession();
                        GetRepositoryStatusCommand getRepStatusCmd = new GetRepositoryStatusCommand(simpleConnection);
                        getRepStatusCmd.setSession(session);
                       getRepStatusCmd.execute();
                        RepositoryStatus repStatus = getRepStatusCmd.getStatus();  
                        if(repStatus.getStatus() == RepositoryStatus.RUNNING) {
                        System.out.println("Cannot delete a repository with status running! Canceling deletion process...");
                        destroy(session);     
                      DeleteRepositoryCommand deleteRepCmd = new DeleteRepositoryCommand(simpleConnection); deleteRepCmd.setRepositoryIdentifier(repIdentifier);     
                      deleteRepCmd.setSession(session);
                      // Excute the command...
                      System.out.println("Running");//Just for checking wheather control is reaching here or not.
                    deleteRepCmd.execute();
         System.out.println("Execution of DeleteRepositoryCommand successful.");
                      destroy(session);
                      public static void destroy(String session) throws CommandException{
                                  DestroySessionCommand destroySessionCmd = new DestroySessionCommand(simpleConnection);
                                  destroySessionCmd.setSession(session);
                                  destroySessionCmd.execute();
                                  session = null;
                                  System.out.println("STATE CONNECTION is DESTROYED......");
    =============================================
    When control reaches at execute method of DeleteRepositoryCommand class, it displays the following error msg.
    com.sap.mdm.commands.CommandException: com.sap.mdm.internal.protocol.manual.ServerException: The current Protocol operation is not supported for the session specified.
    *     at com.sap.mdm.repository.commands.DeleteRepositoryCommand.execute(DeleteRepositoryCommand.java:69)*
    *     at Test_Package.TestDeleteRepository.main(TestDeleteRepository.java:85)*
    Caused by: com.sap.mdm.internal.protocol.manual.ServerException: The current Protocol operation is not supported for the session specified.
    *     at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:112)*
    *     at com.sap.mdm.repository.commands.DeleteRepositoryCommand.execute(DeleteRepositoryCommand.java:64)*
    *     ... 1 more*
    Exception in thread "main"
    Could you suggest me, what i have to do in this situation.
    I need your help.
    Edited by: Tarun Sharma on Jan 2, 2008 5:46 PM
    Edited by: Tarun Sharma on Jan 2, 2008 5:50 PM
    Edited by: Tarun Sharma on Jan 3, 2008 11:32 AM

    Hi Namrata,
    If we are deleting an repository, it means we are making connection with repository that's why we have to createRepositorySession rather than serverSession.
    According to this JavaDoc note:
    "NOTE: This command used to take in a repository session. This command had be changed to take in a server session. The setRepositoryIdentifier is also required."
    the method setRepositoryIdentifier is defined in CreateRepositorySessionCommand not in ServerSessionCommand. That's why we have to use RepositorySessionCmd.
    According to your advice I changed CreateRepositorySessionCommand and AuthenticateRepositorySessionCommand with ServerSessionCommand and AuthenticateServerSessionCommand but getting Same Error "The current Protocol operation is not supported for the session specified."
    Thanks
    Tarun
    Edited by: Tarun Sharma on Jan 3, 2008 10:44 AM

  • Jdbc-statement execute method

    in java documentation
    it is given
    ............., a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
    The execute method executes an SQL statement and indicates the form of the first result. You must then use the methods getResultSet or getUpdateCount to retrieve the result, and getMoreResults to move to any subsequent result(s).
    what is that procedure that return multiple result sets
    please some body clarify or place where i can get more details

    See if out parameters are used i can call CallableStatement's getter methods to retrieve value
    after execution .
    but the api is telling writing a dynamic procedure execution where procedure returns more than
    ResultSet(DQL) or updateCount(DML) . iam lokking for a procedure in oracle where this is possible

  • "Your payment method was declined. Please enter another payment method" Error

    Hello,
    I've been trying to download an app for about two hours now. I recently got a new Macbook and iPad, my iPhone is a bit older and has been used frequently. I have only bought paid apps with my iPhone (and other iPad -- not usable currently). I have been trying to download a game which is $4.99 on my account, I have tried with my Mac, iPad, and iPhone, no luck. Every time I get a error saying "Your payment method was declined. Please enter another payment method". I know for a fact I have more than enough money to pay for this app. All the details have been checked and checked again. What is the problem?
    I also get an error when first buying the game (or attemting to) and it says something along the lines of "You've recently used a new device or computer to access this apple id, please sign in to confirm your purchase". That then leads to my confirmation of my security code on my card, which is triggering the first mentioned error.
    Apple Support has not yet given me a response, can any of you help?

    I think that for some international copyright issue, Apple is now blocking purchases from your store if they detect that your IP is outside the frontiers. I've been using my Canadian Visa Card for two years to purchase from France on ITune Store Canada and I never had a problem until today. Impossible to buy RunKeeper Pro. I get the same message you get. The only option seems to swithch back to IStore France and modify the account details with a french address and a french credit card.
    Are you in a similar situation?

  • I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    I would like to do a program that have one string control and one string indicator, any character that I type in the string control in the same time it will be appear in another string (indicator). How can help me?

    Why not use an event
    Add a While Loop, inside the loop add the Event Sructure.
    Now in the event structure selecd the String Controls.value change event to
    react
    and the new value inside the event that you get,( connect to the String
    indicator box.
    On Sun, 10 Aug 2003 15:58:47 -0500 (CDT), WiltonFilho wrote:
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    > I would like to do a program that have one string control and one
    > string indicator, any character that I type in the string control in
    > the same time it will be appear in another string (indicator). How can
    > help me?
    >
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

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

Maybe you are looking for

  • Safari frozen on start-up, won't open

    This morning, Safari spontaneously started freezing when I try to open it. Nothing new, haven't updated it recently. Everything was working fine then all of a sudden it's not working anymore. I click the Safari icon in the dock, I see the Safari menu

  • How do I add a movie theater to the Siri database?

    How do I add a movie theater to the Siri database?

  • Export quality grainy for TEXT / TITLE

    Hello there, Am kind of a newb, but am getting used to the basics and am happy with the video export quality. For some reason, the TITLE objects are coming out grainy, even when viewed at 100% size. I tried different output types, bitrates, changed f

  • Replacing a comma with a paragraph mark

    Hello All, I have some poor quality address information which is in the form: <ADDRESS>1 High Street, Kensington, London, England, SW1<!ADDRESS> and on the letter I need to convert it into: 1 High Street Kensington London England SW1 Any clues how to

  • How do I get rid of a script error?

    I keep getting this error message:  A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.  Script: https://s3.amazonaws.com/hostjs/load.js:1 It seems