Substring for Strings, what do I use for a int variable???

Hi!
substring for Strings...
String s1 = p.substring(1,2);
but what do I use for a int variable?
int i1 = integ."???????"(1,2);
/Henrik

why, you use maths of course!!
or if you're not up to that, try this:
int x = 931;
String s = x+"";
String res = s.substring(1, 2);
and of course set it back to an int
with Integer.parseInt(res);

Similar Messages

  • In the *.tld,what's the use of the tag " variable "

    For the jsp taglib technology.
    In the *.tld file,accroding to the "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"
    there is an optional tag "<variable>".
    In some document , i saw an example as below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>map</short-name>
    <tag>
    <variable>
    <name-from-attribute>id</name-from-attribute>
    <variable-class>java.util.Map</variable-class>
    <scope>AT_BEGIN</scope>
    </variable>
    </tag>
    </taglib>
    What use of this?
    Can anybody give me an simple example to explain this?
    Thank u!

    Thank u very much?
    But i want to know, if I had set the <attribute> tag
    as the example i had given.Do you mean attribute, or variable in the example you gave?
    Here, I will give you a full example. This tag will set a new variable (given by an attribute name) a value provided by another attribute, and puts that variable into one of the four scopes (page, request, session, application)
    You would use this tag like this:
    <custom:setValue var="theVar" value="What I want" scope="page"/>
    Where var = the name of the variable that will be exported
    value = The value to assign to the variable
    scope = the scope to put the variable into.
    package tags;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.http.jsp.*;
    import javax.servlet.http.jsp.tagext.*;
    public class SetValueTag extends SimpleTagSupport
      private String varName, scope, value;
      public void setVar(String var) { varName = var; }
      public void setScope (String s) { scope = s; }
      public void setValue(String val) { value = val; }
      public void doTag() throws JspException, IOException
        PageContext context = (PageContext)getJspContext();
        if ("application".equals(scope)) context.setAttribute(varName, value, PageContext.APPLICATION_SCOPE);
        else if ("session".equals(scope)) context.setAttribute(varName, value, PageContext.SESSION_SCOPE);
        else if ("request".equals(scope)) context.setAttribute(varName, value, PageContext.REQUEST_SCOPE);
        else context.setAttribute(varName, value, PageContext.PAGE_SCOPE);
    }The tag in your tld would look like this:
      <tag>
        <description>Set the value of a scoped variable</description>
        <name>setValue</name>
        <tag-class>tags.SetValueTag</tag-class>
        <body-content>empty</body-content>
        <attribute>
          <description>The name of the exported variable</description>
          <name>var</name>
          <required>true</required>
          <rtexprvalue>false</rtexprvalue>
          <type>java.lang.String</type>
        </attribute>
        <attribute>
          <description>The value to give the exported variable</description>
          <name>value</name>
          <required>true</required>
          <rtexprvalue>true</rtexprvalue>
          <type>java.lang.String</type>
        </attribute>
        <attribute>
          <description>The the scope of the exported variable</description>
          <name>scope</name>
          <required>false</required>
          <rtexprvalue>false</rtexprvalue>
          <type>java.lang.String</type>
        </attribute>
        <variable>
          <name-from-attribute>var</name-from-attribute>
          <variable-class>java.lang.String</variable-class>
          <scope>AT_BEGIN</scope>
          <declare>true</declare>
        </variable>
      </tag>>
    Then what should i do in the TagHandler programme(A
    javabean handle the tag)?
    And what should i do in the JSP page ?
    Can u give me an simple example?

  • How to find what provider is used to for cipher in a SSL socket's handshake

    Hi,
    I have few security providers loaded with Mozilla-JSS provider above the SunJSSE provider.
    SSLContext is provided by SunJSSE. If I get an instance of Cipher seperately, it says it is provided by Mozilla-JSS.
    How do I know what provider is used inside the socket's handshake method to get the cipher in the following code. Will it be SunJSSE or Mozilla-JSS
    SSLContext sc = SSLContext.getInstance("TLSv1");
    sc.init(null, new TrustManager[] { new SSLTrustManager()}, secRand);
    SSLSocketFactory socketFactory = sc.getSocketFactory();     
    javax.net.ssl.SSLSocket socket = (javax.net.ssl.SSLSocket)socketFactory.createSocket();     
    InetSocketAddress address = new InetSocketAddress(ip, port);
    socket.connect(address, 5 * 1000);
    socket.setSoTimeout(30 * 1000);
    socket.setEnabledCipherSuites(SSL_CIPHER_SUITES);
    socket.setEnabledProtocols(new String[] {"TLSv1"});
    javax.crypto.Cipher cipher = javax.crypto.Cipher.getInstance("DESede/CBC/NoPadding");
    System.out.println("provider for cipher == " + cipher.getProvider().getName() ); -> Mozilla-JSS
    System.out.println("provider for SSL Context is == " + sc.getProvider().getName()); ---> SunJSSE
    Thanks,
    Sreedhar

    I could not get anything extra from the debug option.
    We have a requirement to use FIPS compliant provider. Mozilla-JSS provider is FIPS compliant and SunJSSE is not.
    SSLContext code is not part of the Mozilla-JSS provider API. So, I wanted to use SunJSSE for SSLContext and I would be fine if I am sure that Cipher used inside the SSLSocket handshake comes from Mozilla-JSS.

  • What is OEM_sqlplus_input_finished used for?

    During recovery of my database just for testing purpose I got such error:
    Prosz� poda� dziennik: {<RET>=sugerowany | nazwa_pliku | AUTO | CANCEL}
    ORA-00308: you can't open archived log 'OEM_sqlplus_input_finished'
    ORA-27041: can't open file
    OSD-04002: can't open file
    O/S-Error: (OS 2) System can't find file.
    The OEM_sqlplus_input_finished sounds misterious to me. What is it used for?
    Some words you can see above you probably don't understand are in Polish.
    Chris

    ORA-00308 cannot open archived log 'string'
    Cause: The system cannot access a required archived redo log file.
    Action: Check that the offline log exists, the storage device is online, and the archived file is in the correct location. Then attempt to continue recovery or restart the recovery session.
    OEM is a tool for administering Oracle Databases
    OEM = Oracle Enterprise Manager
    That message perhaps was because of those applications
    were getting close.
    You can check, too the alert file of the database.
    Joel P�rez

  • What is FILE_PLP_STATIC_STATUS used for ?

    Does anyone know what FILE_PLP_STATIC_STATUS is used for? It's used as a source in mapping PLP_StatusDimension_LoadStaticValues. It's part of the files that are needed for a Universal Connector run for Supply Chain Management. But there are no details about what should populate it.
    Thanks for the help!
    -Joe

    ORA-00308 cannot open archived log 'string'
    Cause: The system cannot access a required archived redo log file.
    Action: Check that the offline log exists, the storage device is online, and the archived file is in the correct location. Then attempt to continue recovery or restart the recovery session.
    OEM is a tool for administering Oracle Databases
    OEM = Oracle Enterprise Manager
    That message perhaps was because of those applications
    were getting close.
    You can check, too the alert file of the database.
    Joel P�rez

  • What is the use of 'is available for Everyone'

    anyone please tell me what is the use of 'is available for queries' in the BMM layer.
    Explain with example is appriciated.
    Thank you.

    Hi Viswa,
    For the 'text' property of UI Element, you can provide a fixed value or bind it to context attribute of type String.
    If you provide some fixed value for the text, you can set the width property accordingly.
    The 'wrapping' property makes more sense when you have binded the 'text' property to some context attribute & you do not know the length of the text beforehand (text value may be coming from backend).
    There you can provide value for 'width' property & set 'wrapping' = true, so that fixed text length is visible.
    I think another use case scenario can be if you wish to resize the application window, you can adjust the space taken by the label using width & wrapping properties (resizing window does not have an impact)
    Hope this clarifies your doubt.
    Kind Regards,
    Nitin
    Edited by: Nitin Jain on Apr 15, 2009 12:14 PM

  • TS3297 I have an iPhone and recently bought an iPod 4 touch what l am using the same apple ID for. The iPod won't let me download songs from iTunes it is asking me security questions which I don't think I have put answers to in the first place.

    I have an iPhone and recently bought an iPod 4 touch what l am using the same apple ID for. The iPod won't let me download songs from iTunes it is asking me security questions which I don't think I have put answers to in the first place, because of this it won't let me buy any songs on iTunes

    It's probably asking you to verify the security code found on the back of your credit card.
    Regards.

  • What can I use my Droid Charge for, after I upgrade to the new Samsung Galaxy S2 for VZW on Sept 8?

    what can I use my Droid Charge for, after I upgrade to the new Samsung Galaxy S2 for Verizon on September 8?
    I guess it can run fine on Wi-Fi and become a media player.... or is there a market for 1-month-old Droid Charge phones?
    How much trade-in value can I get from VZW or BestBuy or Amazon?
    Thanks!

    http://www.droid-life.com/2011/08/03/leaked-verizon-roadmap-reveals-potential-launch-dates-for-stratosphere-vigor-bionic-and-more/
    DROID Bionic:  (9/8 launch) – You already know everything about this device, don’t you?
    Samsung Stratosphere:  (9/8 launch) – 4G LTE device running Android 2.3
    HTC Vigor:  (10/6 launch) – Will replace the HTC Thunderbolt
    LG Revolution 2:  (10/20 launch) – Will replace the original Revolution
    Samsung Galaxy Tab P8 (November launch) – Could be the 8.9″ Galaxy Tab?
    Samsung Illusion:  (9/29 launch) – 3G smartphone running Android 2.3
    Samsung Plato:  (January launch) – whatever it is, it was pushed to 2012
    HTC Bliss:  (9/29 launch) – Lower end Android 2.3 device; the chick phone?
    Motorola XOOM 4G LTE:  (9/8 launch) – Assuming this is the date that the 4G LTE upgrade starts. Also when the 4G LTE version will be in stores.

  • Looking for a drum loop app that will run in the background. What are you using?

    Looking for a drum loop app that will run in the background. Suggestions? What are you using? I tried Loopseque and I like it, but I can't make it run once I switch apps. Help please.

        That's definitely strange, kzmidge. I want a working phone in your hands though. I noticed you mentioned you received the suggestion to complete a reset. Did you already do that? Is it working again? Are you receiving an error message?
    If you hesitated a little longer to complete the reset, you can try to place your phone into Safe Mode http://vz.to/rxg0ii and see if you can access mobile sites from your browser. This mode will stop 3rd party applications from running, so you won't be able to use the apps you mentioned but we may be able to narrow down the trouble in Safe Mode. If the mobile sites work, that means the trouble may be in a recently downloaded application and you may be able to avoid the reset my uninstalling some of your more recently installed applications. If it's still giving you trouble, the reset http://vz.to/18wzOCi is the next best step.
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • I want to submit a grant application at Pepsi refresh, however they recommend Firefox 3, 3.5 or 4 - not 3.6, which is what I'm using on my Mac 10.4.11. Can I download another version of Firefox so I can apply for this grant?

    I want to submit a grant application at Pepsi refresh, however they recommend Firefox 3, 3.5 or 4 - not 3.6, which is what I'm using on my Mac 10.4.11. Can I download another version of Firefox so I can apply for this grant? How can I do this?

    If you want to add a new user-agent into User Agent Switcher, you go into preferences > New. Most of the blanks are filled in already, so just change the Mozilla revision number that will be at the end of the User Agent line. To fake 3.5.19, just change rv:1.9.2.19 to rv:1.9.1.19. For the description, put in "Firefox 3.5.19".

  • HT5622 hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    hi. i bought iphone 5 witch was locked, i made factory reset and now phone asking apple ID and pasword witch i dont know. i was writing to seller but he is not answering me. how to set new account for my iphone 5 what i could use it?

    The iPhone has a feature called "Activation Lock" described here:
    http://support.apple.com/kb/PH13695
    Without that Apple ID, you will not be able to use that iPhone.

  • What are the uses for Macbook pro and Macbook air?

    Hi! I am deciding between MBA and MBP and need to know what the different uses for each one was. Like what would you use the MBA for and what would you use the MBP for?? All opinions welcome!!

    They're actually pretty comparible in what they can do if you're talking about the base model of both (say 13") with 4GB RAM. At that level, the Pro has the advantage if you're going to watch or burn DVD's or CD's, as the Air has no optical drive. But otherwise, they're pretty much the same--full-sized, backlit keyboard, camera, beautiful screen, etc. If you're going for more than a basic 13" Pro, then things start to change. For example, you can get up to 8GB RAM on the Pro, and a huge hard drive, you can also get a 15" or 17" size. You will be paying a lot for these, but, obviously, if you're going to be working on, say, making videos (which you may then want burn onto disk) the Pro is very much what you'll want.
    However, if you don't need or want any of that--if, for example, you plan to do the usual programs (word processing, games, web surfing, music, etc.), then you really won't see much difference between the two. At 4GB RAM and a 13" screen, the big difference is going to be thickness and weight, not power. And in this the Air will have the advantage--it's really amazingly slim, light and with a SSD, faster (you pay extra--a lot extra--to get SSD on the Pro).
    Just to make the point, I switched from a 13" Pro to an 11" Air. My hard drive size is half what it was with a Pro, but I was barely taking up half of that amount on the Pro, and so have plenty of room on my 128GB Air (you can get 256GB for the 11" if you order it online). Absolutely everything my Pro did, my Air does (sans optical drive), only faster and lighter and more compact--meaning it takes up less table space, slips in and out of my bag faster, balances on my lap easier, etc. But there was no interruption of service--I switched pretyt seamlessly from 13" Pro to 11" Air.
    The Pro offers you more options for power, screen size, HD size and optical drive. But it's really pretty surprising how few of us need that much power, that much room, or the optical drive. It's very freeing to realize that less can be more than enough.

  • What are the uses of MVC, Extension and how to create it for begineers pls

    what are the uses of MVC, Extension and how to create it for begineers pls
    dont give link for tutorials please explain ,
    thank you,
    Regards,
    Jagrut BahratKumar Shukla

    Hi,
    Check out this link :
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/content.htm</a>
    It is the best possible explanation and documentation that you'll get.
    Thanks,
    Tatvagna.

  • HT3014 my mac has the VGA port and I need a newer monitor for it. what do I use that will connect it. I had a new dell monitor and none of the things that dell said worked. so I am going to get a mac monitor for a second unit.

    my mac has the VGA port and I need a newer monitor for it. what do I use that will connect it. I had a new dell monitor and none of the things that dell said worked. so I am going to get a mac monitor for a second unit.
    my laptop is a 2008 model

    Hmmm... 2008 MBP has...
    Video (Monitor):     1 (DVI)
    Details:     Supports external display in dual display and mirroring modes. VGA output provided by included Apple DVI-to-VGA adapter, S-video output provided by optional adapter (sold separately).
    http://www.everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-2-duo-2 .5-15-early-2008-penryn-specs.html

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

Maybe you are looking for