How to make substring a string in concern with length

hello frds,
i am in need of a very basic clarification.
i have a String like
String st="abcdefg";
String st1=st.substring(0,2);
String st2="ab"
i am getting st1="ab" like what need
but the when i compare st1 and st2 its not returning true (but it shows the same values while debugging)
its because the st1 object is contains length greater that st2.
i tried st1.trim() also
any help
thanks

but the when i compare st1 and st2 its not returning
true (but it shows the same values while debugging)Let me guess. You aredoing something like this.
System.out.println(st1 == st2);Use the equals() method to compare Strings, not ==.

Similar Messages

  • How to make your iPad and iPhone commicate with each other

    How to make your iPad and iPhone commicate with each other

    this is very easy...
    firstly disconnect the DSL modem for the linksys..
    then connect the computer to the linksys router (port 1/2/3/4)..
    then access the linksys setup UI
    open ur web browser
    site: http://192.198.1.1/
    username: [blank]
    password: admin
    now hook up the westell modem.. and goto the status page ...
    check Internet IP.
    if then Internet IP is 192.168.1.* then,
    disconnect the westell from the router and goto the setup page.
    change the LOCAL IP address to 192.168.2.1 (notice the 2.1 and not 1.1)
    save settings....
    connect the westell and viola ur online...
    if the Internet IP is 0.0.0.0 then
    goto the setup page and change the 'Internet connection Type' to 'PPPoE'
    once done the page changes and give u a place to enter a username and a password.. this username and password is given by verizon..
    sud be something like '[email protected]'
    once done save settings...
    goto the status page and hit connect... give it a few moments... u shud get a Internet ip address... if u get one ur online if not then power cycle the entire network. and try check to see if u get an ip..
    hope this helps...
    cheers..
    Life is short... So get movin !!!
    DopeLorD

  • Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8

    Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8 as a control surface ?

    In YAMAHA01v96i:
    Go to DIO/SETUP select Generic DAW. Go to MIDI settings page and set the desired port (personally I use Number 1), Select the same audio frequency you use in your DAW (I use 44.1KhZ)...at this point You should save a scene in you 01V96i to avoid to repeat all the procedure again.
    Open studio manager, go to patch and set the input port from 17 to 32 respectively to USB1-USB16 (this will give you the return from you DAW to the 01v96i
    Save again the scene overwriting the old one.
    in LOGIC
    Click on preferences, select Audio then select 01v96i, then click on control surface and select Mackie design Baby HUI and in the midi session set the same port that you've been setting on the Yamaha 01V96i (Port 1 if you follow this example).
    That's more or less it.
    It worked for me...so far

  • Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hi
    You can refer to these videos :
    http://www.lynda.com/Muse-tutorials/basics-horizontal-scrolling-websites/108131/115685-4.h tml
    https://www.youtube.com/watch?v=gZI_K1TXqOM
    Thanks,
    Sanjit

  • How to get substring from string using index?

    hi,
    here i am having string ,
    i want the pullareddy from below line ,
    i know how to get from substring.
    but i want to get the above using "index",
    can any help how to do it?
    String str1="janapana,pullareddy, in malaysia";
    jpullareddy

    get the start index with indexAt("pullareddy")
    get the end index with adding the length of the word to the start
    get the char[] of str1 with toCharArray()
    make a new string with the chars from start to end index.

  • How to make comparison between strings using Labview

    helo, i want to know, how to make comparison between array of string.?
    the transmitter have send the assign text such as
    A hello            Bhye  Cbye

    Hi Syanitaa,
    You actually only need to post the question once. 
    Multiple duplication. Please refer to this thread.

  • HT2801 How to make external "SuperDrive" work on iMac with failed built-in?

    WHY is my new external "SuperDrive" "designed exclusively for use with Mac computers that do not have a built-in optical drive"?  How can I make it work on my iMac with a failed built-in "SuperDrive" that was obviously junk to begin with?  I ordered it from a Staples kiosk that had zero product information but the name of the product was USB SuperDrive and it was made by Apple so I reasoned it would run on my Apple.  I bought an LG 2 months ago when the built-in failed but the LG only worked about a month then every disc burn was aborted as "error."  So I bought new burn software from the Apple app store but still "error" so I went to Staples and bought this and it didn't work so I ise a magnifying glass to read the light grey letters on the white box and it says "Compatible with Mac systems without a built-in optical drive."  I found articles online advising how to hack my own computer to make this work but I am low-tech and afraid of wrecking my computer.  I am FURIOUS with Apple, I buy it only because Windows gave me such grief but honestly Apple hardware has OFTEN proven itself short-lived and low quality.  PLEASE how do I burn an audio CD with my stupid iMac peice of garbage?

    Calm down.
    If you so choose here are some quality optical drives you can purchase, online here.
    http://eshop.macsales.com/item/OWC/VLU2SD24XS/
    http://eshop.macsales.com/item/OWC/MR3F82SD24S/
    For Mac burning software, you can purchase and use Roxio Toast.
    http://www.roxio.com/
    OR you can try this freeware software called simply Burn.
    http://burn-osx.sourceforge.net/Pages/English/home.html

  • How to make the Printer deskjet 3940 compatible with Windows 7, home basic, 32 bits?

    I have HP Deskjet 3940 Printer. I recently purchased a Lenovo desktop( C320, 57-302429) which has Windows 7,home basic,32 bits operating system. The said printer does not work with the above computer. Please guide how to make this printer compatible with the above operating system.
    This question was solved.
    View Solution.

    1. Click the Start button, click Control Panel and double click Devices and Printers.
    2. Click Add a Printer.
    3. Select Add a local printer.
    4. Choose an existing USBx Local port, click Next.
    5. Click the Windows Update button.
    6. After the update finishes, search for the 3940 driver.
    7. click Next,Next,Next,Next,Finish
    Please mark the post that solves your issue as "Accept as Solution".
    If my answer was helpful click the “Thumbs Up" on the left to say “Thanks”!
    I am not a HP employee.

  • How to make the active save-to-file with the data from GPIB ?

    Hello,,everybody !!
    I want to make the active save-to-file with the data from GPIB since starting the measurement. To save-to-file at the end of measurment is somehow risky for losing the data because my measurment have to take for long time (eg. 24-48 hours).
    Thank you in advance for anybody's help !!

    Thanks Dennis,
    I have already append, I got it but still have one small problem that between each line it has the blank line. Example as below ,
    16:40:33 54.24
    16:40:34 54.23
    16:40:35 54.24
    I want to get rid of the blank line in between.. Do you have the idea about it ?

  • How to get substring from string starting from the end of string

    Hi
    How to cut from string:
    $A=C:\ClusterStorage\Volume1\WXP-plwropc300\Virtual Hard Disks\WXP-PLWROPC300_EE20E00F-315E-4781-A6DE-68497D4189B8.avhdx
    this substring (name of VHD file): WXP-PLWROPC300_EE20E00F-315E-4781-A6DE-68497D4189B8.avhdx
    This script should be universal so the best way to be cut all leters from the end of string $A till get the first mark \
    Thank you for help.
    Tomasz
    Kind Regards Tomasz

    PS > Split-Path 'C:\ClusterStorage\Volume1\WXP-plwropc300\Virtual Hard Disks\WXP-PLWROPC300_EE20E00F-315E-4781
    -A6DE-68497D4189B8.avhdx' -leaf
    WXP-PLWROPC300_EE20E00F-315E-4781-A6DE-68497D4189B8.avhdx
    PS >
    That is what "Split-Path" is for:
    ¯\_(ツ)_/¯

  • How to make buttons of Strings from a db

    I have this program "SokGenre" which connects to a db and take out some Strings and put them in a vector.
    Now I would like to have an applet with Buttons and each button shall have text from one of the strings from the db.
    Any tips? How shall I do?
    How do I "link" the programs to eachother? Im a newbie....
    import java.sql.*;
    import java.util.*;
    class SokGenre {
         public static void main(String[] args) {
              Connection conn = null;
         try {
              Class.forName("org.gjt.mm.mysql.Driver");
         conn = DriverManager.getConnection( "jdbc:mysql://localhost/MyDb?user=root&password=" );
         Statement stmt = conn.createStatement();
         String query = "SELECT Gnamn FROM genre WHERE Gover='-'ORDER BY Gama";
         ResultSet rs = stmt.executeQuery(query);
         Vector vektor = new Vector();
         while (rs.next()){
                        vektor.addElement(rs.getString("Gnamn"));
              System.out.println("Vektor: "+vektor);
         catch(Exception e) {e.printStackTrace(System.err);}
         finally {
              try {conn.close();}
              catch(Exception e) {e.printStackTrace(System.err);}

    Here's some info on Applets.
    http://java.sun.com/docs/books/tutorial/applet/index.html
    You can create a Button using a String so that shouldn't be any problem. You can add Buttons to an Applet. You will have to learn about ActionListeners if you want your program to do something when a Button is clicked.
    The code you have might be included in the Applet class that you create. Or you might have a button to "Retrieve" the data from the db and clicking the button causes the ActionListener to call the SokGenre main method.

  • How to extract substring from string... how to find the index?

    suppose i have a string like
    "string1 string2 string3 string4 string....stringK...stringN"
    i would like to extract the substring from string4 to stringK-1
    where stringK and string3 are pre defined strings (ie, i know exactly what stringK and string3 is).
    is there a function to extract the substring from string4 to stringK-1
    or is there a function i can use to determine the index of the end of string4 and the start of stringK?
    thks!

    If your substrings are seperated by a space (or by any other character that isn't used in any of the substrings), you could use something like StringTokenizer.
    If you wanna get real fancy, use the split method of String.

  • How to make the Access Gate SDK work with Web Gate

    When we want control the display of one area in one page, we can define this area as one resource then control the access of it. But when the user has been authenticated in the application, how can we get the user session and then call Access Gate SDK to check if the user is authorized? The following is one utility class to archive it.
    * $Id: CreateUserAction.java,v 1.1 2005/10/11 23:19:34 jason Exp $
    * $Revision: 1.1 $
    * $Date: 2005/10/11 23:19:34 $
    * Copyright (C) 1972 - 2005, Oracle Co. All Rights Reserved
    * The program(s) herein may be used and/or copied only with
    * the written permission of Oracle Co. or in accordance with
    * the terms and conditions stipulated in the agreement/contract
    * under which the program(s) have been supplied.
    package oblix.view;
    import com.oblix.access.ObAccessException;
    import com.oblix.access.ObConfig;
    import com.oblix.access.ObResourceRequest;
    import com.oblix.access.ObUserSession;
    import javax.servlet.http.Cookie;
    import javax.servlet.http.HttpServletRequest;
    * @author zhoujian
    public class OblixUtil {
    private static String ObSSOCookie = "ObSSOCookie";
    private OblixUtil() {
    * Check if the user is Authorized
    * @param request
    * @param rescourceUrl
    * @return
    public static boolean isAuthorized(HttpServletRequest request,
    String rescourceUrl) {
    return isAuthorized(request, "http", rescourceUrl, "GET");
    * Check if the user is Authorized
    * @param request
    * @param resourceType
    * @param rescourceUrl
    * @param resourceMethod
    * @return
    private static boolean isAuthorized(HttpServletRequest request,
    String resourceType, String rescourceUrl, String resourceMethod) {
    try {
    ObConfig.initialize();
    ObResourceRequest resource = new ObResourceRequest(resourceType,
    rescourceUrl, resourceMethod);
    ObUserSession session = getObUserSession(request);
    return session.isAuthorized(resource);
    } catch (ObAccessException oe) {
    oe.printStackTrace();
    ObConfig.shutdown();
    return false;
    * Get the Oblix user session from the request.
    * @param request
    * @return
    * @throws ObAccessException
    private static ObUserSession getObUserSession(HttpServletRequest request)
    throws ObAccessException {
    String token = getCookieValueByName(request.getCookies(), ObSSOCookie);
    if (token != null) {
    return new ObUserSession(token);
    return null;
    private static String getCookieValueByName(Cookie[] cookies, String name) {
    for (int i = 0; i < cookies.length; i++) {
    if (cookies[i].getName().equalsIgnoreCase(name)) {
    return cookies[i].getValue();
    return null;
    }

    Couple of options. You seem have to taken the Access Gate based approach. I will throw this in any way and you can make a call which one you want to use.
    If its a web application you can control authorization based on Resource by defining policy in the Access Manager.
    You mentioned aout display of one area in one page. That should be driven off of User attribute or custom logic. If it is driven off of User attribute then you can return header variable and you can check in the code as opposed to writing custom access gate.
    Now if you do want to write custom access gate when the resource is already protected by a Web gate,
    you can get the ObSSOCookie from the users browser session.
    You can pass the URL to the IsAuthorized method and call.
    Now here you have to install the Access Server SDK on the server, create custom access gate and then write the code and deploy it on that server.
    THanks
    Ram

  • How to make boot disk for MacBook Pro with Mavericks pre-installed

    Hi -
    I recently bought a new 15" MacBook Pro with Retina Display, which came pre-installed with Mavericks (10.9.0).  I want to make a bootable USB disk of the system software, and have successfly used DiskMaker X (formerly Lion DiskMaker) to make the USB boot disks for Lion and Mountain Lion.  In those cases, however, I was running earlier versions of the OSX, and downloaded the new OSX version -- Lion and Mountain Lion -- from the App Store in order to make to make the disk.  In this case, however, Mavericks was pre-installed, and I was unable to download it from the App Store (an alert said that it couldn't be installed on this computer... presumably because it was already installed).  I would apprecite any suggestions as to how I can create the boot disk without the ability to download Mavericks.  Thanks very much for any help anyone can provide.
    Shelly

    Open App Store and locate the full installer download file (5.29 GBs) for 10.9.1. Download to your computer.
    Make Your Own Mavericks, Mountain/Lion Installer
    After downloading the installer you must first save the Install Mac OS X application. After the installer downloads DO NOT click on the Install button. Go to your Applications folder and make a copy of the installer. Move the copy into your Downloads folder. Now you can click on the Install button. You must do this because the installer deletes itself automatically when it finishes installing.
        2. Get a USB flash drive that is at least 8 GBs. Prep this flash drive as follows:
    Open Disk Utility in your Utilities folder.
    After DU loads select your flash drive (this is the entry with the mfgr.'s ID and size) from the leftside list. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the partition scheme to GUID then click on the OK button. Click on the Partition button and wait until the process has completed.
    Select the volume you just created (this is the sub-entry under the drive entry) from the left side list.
    Click on the Erase tab in the DU main window.
    Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the button for Zero Data and click on OK to return to the Erase window.
    Click on the Erase button. The format process can take up to an hour depending upon the flash drive size.
        3. Use DiskMaker X to put your installer clone onto the USB flash drive.
    Make your own Mavericks flash drive installer using the Mavericks tool:
    You can also create a Mavericks flash drive installer via the Terminal. Mavericks has its own built-in installer maker you use via the Terminal:
    You will need a freshly partitioned and formatted USB flash drive with at least 8GBs. Leave the name of the flash drive at the system default, "Untitled." Do not change this name. Open the Terminal in the Utilities folder. Copy this command line after the prompt in the Terminal's window:
    sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction
    Press RETURN. Enter your admin password when prompted. It will not be echoed to the screen so be careful to enter it correctly. Press RETURN, again.
    Wait for the process to complete which will take quite some time.

  • HOW TO MAKE A HIGH DEFINITION AUDIO DVD WITH PREMIERE CS2

    I have been working with my CS2 Premiere to create some auto play high definition, audio-only DVDs that are autoplay.  To clear the air, yes I know that CS4 will permit 24bit-96 kHz.  For the time being 16 bit-48 kHz, is still better (marginally) than CD, but it permits greater playing times.  Yes, I know that the autoplay without menues "feature" is bogus, and was never corrected by Adobe.  So much for their interest in their customers.
    I found a simple workaround for the autoplay/no menues feature.  Just make a DVD-RW with menues.  Then use DVD-DeCryper/Shrink/Nero - whatever to make an autoplay DVD onto a permanent disc.  It works well.
    Here is my latest crazy problem: How to get really long playing time.  I know I can make high qualitye DVD-A's up to 3 hours using Minatonka Bronze.  Unfortunately, DVD-A discs are worthless as they cannot play in 90% of DVD players, but they prove the time point.
    I have three 48 kHz files that I created in Adobe Audion.  The were 1.599, 0.911, and 0.974 GBs in size.  That added up to 3.480.  The playing time is about 2:30 Hours; quite a bit less than 3 hours.   I tried burning a DVD with these, audio-files-only.  I checked lowest quality video, used no video, and got an Export To DVD error that I had "insufficient" space on the 4.7 GB disc!  So, I used the two latter files, which added to only 1.884 GB.  Premiere did not baulk, and it successfully burned a DVD that played.  Then I added the 1.599 GB file, and, once again, it produced an error.  This was clearly not going to work.
    At this point, I realized that Audition had done what it liked to do: It had saved the 16 bit-48 kHz files as 32 bit-48 kHz!  So, I went back to Audition and used EDIT to change the files to genuine 16 bit-48 kHz files.  When I opened them in Premiere, Premiere reported 16 bit-48 kHz files.  Their sizes were now, 0.799, 0.456, and 0.487 GB.  Please note that this totals 1.742 GB.  This is less than the 1.884 GB I had successfully used before.   Once again, I was getting the "inssufficient" space error.  This is nuts.  The disc can hold 4.3+ GB, but won't fit 1.742.GB.
    So, anybody got some ideas?
    Mike

    Jim,
    I cannot believe you are wasting my time and the space of this forum with your irrelevances.  It would have been better had you just tried to answer my question, which is the purpose of these forums.  Why engage in useless chatter?
    I said nothing about any great sonic difference betweein 16/48 and 16/44 digital audio; I said "marginally."   In English that means very little difference.  I'm not going to prove to you with distortion and frequency response plots that there is some minor difference, it is a fact of life.  You, in fact, just stated a difference.  The difference between a 24 kHz cutoff and a 22 kHz custoff  is a difference which you give, to back up your absurd statement that there is no difference.  This can actually translate to a minor, difference in THD at higher audio frequencies, but who cares?   Well, you apparently care, because your beligerant non-reply to my question was that "fewer...would notice ."  In English that means that some would notice.
    What my question had to do with MP3 junk, or multichannel sound, I don't know.  Why should I do, as you suggest, and make DVD-A's when one needs only stereo?  This is a Premier forum, not a DVD-A forum.  Why not bother DVD-A junkies on Minatonka fourms?  DVDs can handle stereo PCM very nicely.  Classic Audio has marketed their 24/96 DADs for many years and so have a few other companies.   They have been well received by some "golden eared" types.  I hope they don't upset you.  There is a good possibility that DVD may only be around as a "legacy" feature on BLU RAY in future years.  DVD-A was DOA years ago and SACD may go just away; DVD-A is almost that.  So, PCM stereo sound DVD's are a good bet that the resultant disc will be playable on many people's players as well as future players.  The longer playing time that may be available would make listening to concerts easier, rather than breaking them up into segments.
    If you want to argue my motives, or tastes, I suggest you go to another forum and discuss you theories.  If you actually have something productive to say about the problem I pointed out, that would be welcome.
    Mike

Maybe you are looking for

  • Upgrade from BOE XI 3.0 to 3.1

    Hi, We need to upgrade from our current BOE XI 3.0 to 3.1.  According to Upgrade Guide for XI 3.1, "To install the .NET components (which we need) in BusinessObjects Enterprise XI, uninstall XI 3.0, and then install XI 3.1".  There's no mention how t

  • Icons in Forms 6i

    I have an application which is working on Windows NT/workstation (client server) and forms 6i Now the problem is the icons in the menus and other places are not appearing .. only some icons like save clear have appeared others like query etc do not a

  • I placed the order for iphone 4s on 21st august 2012. it got cancelled on 23rd august 2012 but till now i havent got any refund from apple. is that normal or i shud take some more actions?

    i placed the order for iphone 4s on 21st august 2012. it got cancelled on 23rd august 2012 but till now i havent got any refund from apple. is that normal or i shud take some more actions?

  • Can't open EM

    Using Windows Server 2008. Have admin rights. Server is not Internet connected and is not on a domain. Clicking on EM opens IE8, gives emkey error. States emkey is misconfigured. Running emctl status emkey generates the following: Microsoft Windows [

  • Broadcast Monitor

    Ok, I'm afraid I didn't understand much in the other posts about broadcast monitors. But perhaps someone can lay out a simple, easy to understand suggestion for me. I want to be able to preview my titles (from FCP AND photoshop CS3, Motion, & Livetyp