How to - print a literal string that contains in java

Trying to output a string with double quotes..
ex. "Hello World"
System.out.println(""Hello World""); won't work....

If you want to print a " you need to put a \ before the quote:
System.out.println("\"Hello World\"");

Similar Messages

  • I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    I never used LabView but need to generate a RS-233 serial output string that contains an IRIG timestamp based on a contact closure. Is LabView an appropriate tool to do this? How much does it cost to get started with the product?

    Labview isn't cheap, but it would certainly allow you to build a program (set of vi's - virtual instruments) that would do what you describe. Where would the timecode information come from? Your vi, or program, would: Start up, initialize the serial port, loop until a trigger happened, read the timecode (from where?), output that timecode out the serial port in a loop until you pressed the stop button. There is a free evaluation of Labview software available from NI - the base product itself runs about $995.
    - Dave

  • How to print a PDF file that was display in my page...

    Hi !. My doubt would be the following one... I would like to know how to print a pdf file that was displayed in my page ?... I mean the PDF file not the page...
    The PDF would be in this url:
    http://iprodesa.lasegunda.com.ar:8090/datos/pdf/830.pdf
    How could I implement this ?...

    This first question which comes to mind is how do you display the pdf file in the browser?
    For this the browser uses a plug in (e.g. adobe reader) which already has the ability to print the pdf file. Depending on the version of your plug in, printing is started differently.
    Timo
    Ps: which jdev version do you use?

  • How do I tell Arch/pacman that I have Java installed?

    Since Sun JDK is removed and I have had to install it manually, how can I tell Arch/pacman that I have Java runtime installed and stop pacman from dragging in OpenJDK when installing a java app?
    Regards,
    BTJ
    Last edited by bjorntj (2011-09-10 21:37:32)

    Then just create an empty package which is called jdk.
    pkgname=jdk
    pkgver=7
    pkgrel=3
    pkgdesc="The Java Development Kit"
    url=http://jdk7.java.net/
    arch=(i686 x86_64)
    license=(custom)
    provides=('java-environment=7')
    conflicts=('java-environment')
    package(){
    /bin/true
    or http://codepad.org/I50Qx8fT
    But remember, doing something like that, you are responsible if things break. Because e.g. if you forget about all this and ask people here for help, this might get very ... a big waste of time
    Last edited by Army (2011-09-10 22:01:56)

  • How do Import a csv file that contains strings

    I have a file that contains numbers as US formmated $$$  such as $1,123,123,123  I have a perl script on one of our linux servers that creates the csv file as
    "Total Dollars","$1,123,123,123","some other string","etc"  but when I import the file into numbers
    Unnamed Table
    Average Price'
    $160
    686'
    $222
    482'
    $114
    820'
    $188
    062'
    I cant find a setting anywhere that says to ignore commas inside a string.  This works in most other applications.

    I apologize but you wrote :
    WALTER-MILANO-ITALY wrote:
    You should be now able to import the file using ; as separator or if you prefer you can do again the change  of ; with ,
    It's not a matter of preferences. The OP can't import a file whose values are separated by semi-colons.
    He must replace them by commas.
    With your scheme :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    after your step 1
    'Total Dollars';'$1,123,123,123','some other string','etc'
    after your step 2
    'Total Dollars';'$1,123,123,123''some other string''etc'
    and the datas are completly unusable
    A possible scheme would be :
    Original datas
    'Total Dollars','$1,123,123,123','some other string','etc'
    'Totals Dollars','$12,123,123,123’,’blahblah’,’etc'
    after possible step 1 (replace ‘,’ by ",")
    'Total Dollars";"$1,123,123,123";"some other string";"etc'
    'Totals Dollars";"$12,123,123,123";"blahblah";"etc'
    after possible step 2 (replace single ‘ by ")
    "Total Dollars";"$1,123,123,123";"some other string";"etc"
    "Totals Dollars";"$12,123,123,123";"blahblah";"etc"
    after possible step 3 (replace ";" by ",")
    "Total Dollars","$1,123,123,123","some other string","etc"
    "Totals Dollars","$12,123,123,123","blahblah","etc"
    This one may be imported by Numbers on thez OP’s machine.
    I don't know if these changes may be done with Perl but I know that they are easy to do with AppleScript.
    But honestly, if Perl is able to build a TAB separated values file, it would be more efficient.
    Yvan KOENIG (VALLAURIS, France) mercredi 25 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

  • How can I list all folders that contain files with a specific file extension? I want a list that shows the parent folders of all files with a .nef extension.

    not the total path to the folder containing the files but rather just a parent folder one level up of the files.
    So file.nef that's in folder 1 that's in folder 2 that's in folder 3... I just want to list folder 1, not 2 or 3 (unless they contain files themselves in their level)

    find $HOME -iname '*.nef' 2>/dev/null | awk -F '/'   'seen[$(NF-1)]++ == 0 { print $(NF-1) }'
    This will print just one occurrence of directory
    The 'find' command files ALL *.nef files under your home directory (aka Folder)
    The 2>/dev/null throws away any error messages from things like "permissions denied" on a protected file or directory
    The 'awk' command extracts the parent directory and keeps track of whether it has displayed that directory before
    -F '/' tells awk to split fields using the / character
    NF is an awk variable that contains the number of fields in the current record
    NF-1 specifies the parent directory field, as in the last field is the file name and minus one if the parent directory
    $(NF-1) extracts the parent directory
    seen[] is a context addressable array variable (I choose the name 'seen'). That means I can use text strings as lookup keys.  The array is dynamic, so the first time I reference an element, if it doesn't exist, it is created with a nul value.
    seen[$(NF-1)] accesses the array element associated with the parent directory.
    seen[$(NF-1)]++ The ++ increments the element stored in the array associated with the parent directory key AFTER the value has been fetched for processing.  That is to say the original value is preserved (short term) and the value in the array is incremented by 1 for the next time it is accessed.
    the == 0 compares the fetched value (which occurred before it was incremented) against 0.  The first time a unique parent directory is used to access the array, a new element will be created and its value will be returned as 0 for the seen[$(NF-1)] == 0 comparison.
    On the first usage of a unique parent directory the comparison will be TRUE, so the { print $(NF-1) } action will be performed.
    After the first use of a unique parent directory name, the seen[$(NF-1)] access will return a value greater than 0, so the comparison will be FALSE and thus the { print $(NF-1)] } action will NOT be performed.
    Thus we get just one unique parent directory name no matter how many *.nef files are found.  Of course you get only one unique name, even if there are several same named sub-directories but in different paths
    You could put this into an Automator workflow using the "Run Shell Script" actions.

  • How to cd to a directory that contains spaces in the name

    A brain dead application has created a directory hierarchy that contains white spaces in the directory path. For example: /first_dir/second dir/third dir/filename.
    I want to look at the file from the command line via iTerm/Terminal but I can not get there because the whitespace is interpreted as the end of the text string. Example: cd /first_dir/second dir results in "/first_dir/second no such file or directory"
    If I try "escape" the whitespace with: cd /first_dir/second\ dir/third\ dir I get an error that says "/first_dir/second dir/third dir no such file or directory"
    How can I change to the desired target directory?
    Second question, why do people do such stupid things? Haven't they heard of the underscore "_" for a space??
    Thanks

    How can I change to the desired target directory?
    Drag the file or enclosing folder into the Terminal window instead of attempting to type the path out.
    Second question, why do people do such stupid things? Haven't they heard of the underscore "_" for a space?
    Because they write applications intended for the majority of Mac users, who only go into the Terminal or similar software when troubleshooting.
    (56433)

  • Regex with strings that contain non-latin chars

    I am having difficulty with a regex when testing for words that contain non-latin characters (specifcally Japanese, I haven't tested other scripts).
    My code:
    keyword = StringUtil.trim(keyword);
    //if(keywords.indexOf(keyword) == -1)
    regex = new RegExp("\\b"+keyword+"\\s*;","i");
    if(!regex.test(keywords))
    {Alert.show('"'+keywords+'" does not contain "'+keyword+'"'); keywords += keyword + "; ";}
    Where keyword is
    日本国
    and keywords is
    Chion-in; 知恩院; Lily Pond; Bridge; 納骨堂; Nōkotsu-dō; Asia; Japan; 日本国; Nihon-koku; Kansai region; 関西地方; Kansai-chihō; Kyoto Prefecture; 京都府; Kyōto-fu; Kyoto; Higashiyama-ku; 東山区; Places;
    When the function is run, it will alert that keywords does not contain keyword, even though it does:
    "Chion-in; 知恩院; Lily Pond; Bridge; 納骨堂; Nōkotsu-dō; Asia; Japan; 日本国; Nihon-koku; Kansai region; 関西地方; Kansai-chihō; Kyoto Prefecture; 京都府; Kyōto-fu; Kyoto; Higashiyama-ku; 東山区; Places; " does not contain "日本国"
    Previously I was using indexOf, which doesn't have this problem, but I can't use that since it doesn't match the whole word.
    Is this a problem with my regex, is there a modifier I need to add to enable unicode support or something?
    Thanks
    Dave

    ogre11 wrote:
    > I need to use refind to deal with strings containing
    accented characters like
    > ?itt? l?su, but it doesn't seem to find them. Also when
    using it with cyrillic
    > characters , it won't find individual characters, but if
    I test for [\w] it'll
    > work.
    works fine for me using unicode data:
    <cfprocessingdirective pageencoding="utf-8">
    <cfscript>
    t="Tá mé in ann gloine a ithe;
    Nà chuireann sé isteach nó amach
    orm";
    s="á";
    writeoutput("search:=#t#<br>for:=#s#<br>found
    at:=#reFind(s,t,1,false)#");
    </cfscript>
    what's the encoding for your data?

  • How move a physical disk directory that contains images

    PSE 11. How can I move a directory on my hard drive that contains images to another drive from within PSE 11? Thanks.

    Hi Bazsl,
    Just a quick answer, late to pick up my wife -grin.
    Starting with the assumption you are just seeing the column of directories without the indication of what drive they are on:    If So then:
    On the left margin next to the begining of the yellow folders aka directories, there is a small symbol of two yellow folders, if you click it the normal directory view will appear  (also assuming you are familar with earlier versions of PSE ).
    Then you can click and drag the directory to its new location, again the system may take a few minutes to complete the move if you have a big catalog of pictures...
    gotta run..
    Al

  • Search for a string that contains a '

    I am searching for an email address that contains a ' (o'[email protected]). I think I'd use some sort of ESCAPE character around the tic but I can't seem to get this to work. Appreciate the help.
    select email_addr from customer
    where email_addr = 'o'[email protected]'
    That would be the SQL - should this work?
    select email_addr from customer
    where email_addr = 'o\'[email protected]' ESCAPE ('\'
    This is returning a string not properly terminated error
    Thanks

    A quick search provides this:
    Re: URGENT  update a table with a text that has a single quote in it
    or indeed:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements003.htm#SQLRF00218
    Message was edited by:
    Boneist

  • Does anyone have any idea how do i key in number that contains 20digit, 17 decimal places?

    I need to key in a number that contains at least 17 decimal places using numeric digit control and i need to use expression note as well. Can anyone help?

    After laying down a numeric control right click on it and select "Format and Precision..." to change the number of decimal places. You can also right click and change the "Representation" of the numeric control. By default it will be a DBL which is a 64 bit decimal number with an approximate range of 10**(-308) to 10**308. This is about 15 decimal digits of precision. I know SGL will only give you 10**(-38)to 10**38, which is about 7 decimal digits of precision. Neither of these will cut it for what you are trying to do.
    I would recommend using the Extended Precision (EXT) representation. According to the linked document La
    bVIEW's implementation of the Extended Precision follows the IEEE 80-bit spec(on Windows OSes). Supposedly even the IEEE 128-bit spec(not implemented on the Windows OSes)only gets you 19 decimal places but I am not sure what the limitations of LabVIEW's implementation are. (I found a good table in the LabVIEW help title, "Numeric Data Types Table".)
    I was able to successfully get 17 digits after the decimal point but that was with a leading 0 only before the decimal point. I think you may just be approaching the limit of how a number can be represented in this programming language.
    Anyone else?
    -scraggs99

  • How do I tranform a string that was strored in binary/hex in SQL back to hex/binary to store it in another location

    I have a local database where the password is stored as binary for security.  I do not want the original.  I need to be able to restore a person's password if they don't login for a long time (two onths or more...the system deletes their password). 
    If I store the binary/hex password by name, I should be able restore the hex/binary to the table and they can login.  How do I convert the string back to a hex value to set into the tble again ?

    I have a local database where the password is stored as binary for security. 
    That's not secure, never store passwords, use (store) only hash (+salt) values for compare:
    http://en.wikipedia.org/wiki/Cryptographic_hash_function
    http://en.wikipedia.org/wiki/Salt_(cryptography)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How Do I Convert a String that Names an Object to a Reference to the Object

    You get many program-specific object names in the XML that is returned by describeType.  Suppose I find an object that interests me.  What is the best way to convert the String that names the object (e.g. the id of the object) to a reference variable that points to the object? 

    Sure.  I am working on a complex application that involves several ViewStacks, several Accordions, some checkboxes, some radio buttons, some text boxes.  These components are scattered about, but all are children of a base class that is successfully enumerated by
    var classInfo:XML = describeType(vwstk);
    Suppose I write a loop as follows:
     for each (var a:XML in classInfo..accessor){
    Inside that loop I have a series of tests like
    if (a.@type == "mx.controls::CheckBox"{
    Then, I iterate thru all of the children of the base class as in:
    for  
    (var u:Object in vwstk)
    {        if  
    Inside the if I persist the checked/not checked status of the checkbox.
    The tricky part is going from the string a.@name to the Object reference u.  I doubt my proposed method will work.  Do you have a better idea?

  • Firefox exits DOM fullscreen when clicked on a swf, how do I have a div that contains flash in a DOM fullscreen?

    I am trying to make a div that contains flash to go fullscreen
    The markup:
    <div id="outer">
    <div id="top"/>
    <div id="flashContent"/>
    <div id="bottom"/>
    </div>
    This wiorks
    if (outer.mozRequestFullScreen) { outer.mozRequestFullScreen();}
    But when I click on a div #flashContent the browser exits fullscreen immediately. This happens only in Firefox, all other browsers stay in fullscreen. Is there a solution?

    We aren't able to answer development related questions on these forums. I suggest looking for help on the Mozilla Developer Network site: https://developer.mozilla.org/en-US/

  • Need to replace the string that contains '|'   character using replaceFirst

    I have the code snippet like this
                   String aaa= "HEY | PRAKASH, HOW ARE YOU";
                   String bbb = aaa.replaceFirst("HEY | PRAKASH", "HI");
                   System.out.println(bbb);
    I want the output as
    HI,HOW ARE YOU
    But the output I am getting is      "HI| PRAKASH, HOW ARE YOU"
    Wat is the issue with '|' symbol, is there any way to achive this......

    String aaa= "HEY | PRAKASH, HOW ARE YOU";
    String bbb = aaa.replaceFirst(java.util.regex.Pattern.quote("HEY | PRAKASH"), "HI");
    System.out.println(bbb);

Maybe you are looking for

  • EJB 3.0 integration in FDS, with Annotations

    We have been working with the EJB 3.0 implementations and see a lot of synergy between the new approach to enterprise Java with this new specification, and would love to see FDS add an adaptor to support it. Our new entity/session beans have annotate

  • SPA 2100 Problem with Belkin Router

    My setup is motorola cable modem>>>>SPA2100>>>>Belkin Wireless Router. My phone works fine but i cant get the internet to work wirelessly through my router. when i connect the 2100 to the router through one of the 4 hardwired computer ports on the be

  • Call function ZRV_BELEG

    Hello, We need to create a ZRV_BELEG number range, my question is if possible to call on function module RV_INVOICE_DOCUMENT_ADD, to this Z range: Neue Nummernvergabe außer im Simulationsmodus       IF NOT kom-posting EQ 'H'.         CALL FUNCTION 'N

  • Intercompany Procesing

    I am working on inter company credit memo and I am having defficutliy in inter-company.  Here is my situation. Order type "CR" Customer invoice "G2" Inter company invoice "IGA" system say's Error Log             0060596042 000010 The item has been fu

  • Delivery to multiple invoices for different BPs

    Hi, I have the following scenario: You add a delivery note for one customer. There are situations when should be three different invoices, but for other 3 different BPs as the customer who received the goods is not necessarily the one paying for them