Problems parsing double quote
I have been trying to figure out my problem for several hours, but still didn't get it. Hope to get an idea from you guys. My code is as follows:
var astr;
var outCr ="|";
var outLf = "\u0000";
var cr = "\n";
var lf ="\r";
var ddQuote=""";
var dtQuote='\"';
astr = "<%=firstDesc%>";
astr.replace(outCr,cr);
astr.replace(outLf,lf);
astr.replace(ddQuote, dtQuote);
while (astr.indexOf(outCr) > 0) {
z = astr.indexOf(outCr);
astr = astr.substring(0, z) + cr + astr.substring(z+1,astr.length );
while (astr.indexOf(outLf) > 0) {
z = astr.indexOf(outLf);
astr = astr.substring(0, z) + lf + astr.substring(z+1,astr.length );
while (astr.indexOf(ddQuote) > 0) {
z = astr.indexOf(ddQuote);
astr = astr.substring(0, z) dtQuote astr.substring(z+1,astr.length );
document.form1.description.value=astr;
The value of firstDesc is a very big string from the database that contains carriage return, linefeed, single quote and double quote. It needs to be displayed in a HTML text area. Now everything works fine except the double quote. A firstDesc value containing double quote will not appear in the text area, and it even stop my jsp page and disable other buttons. But if I get rid of the code handling the double quote, everything works fine. What's the problem?
maybe you should ask this question in a JavaScript forum.
Similar Messages
-
HttpServletRequesr.getParameter : Problem with double quotes
Hi,
I am having a problem in accessing "POST" parameters which have "quotes" in it. For example,
If the post parameter named param contains Hello "(hw)" World, the getParameter returns Hello instead of Hello "(hw)" World.
I'm not sure if this is related to encoding. Encoding seem to be ISO-8859-1 (got from getCharacterEncoding).
Any clue of the problem ?How do you send the post parameters. Do you send them usign a html from or are you sending them programaticaly. In that case make sure the keys and values are URL encoded with UTF-8
-
StringTokenizer class problem with strings in double quotes
Hello Technocrats,
I have a problem with tokenizing following string enclosed in (). (abc," India, Asia", computer engineer). My separator is ",", thus StringTokenizer class gives me 4 tokens namely abc, "India, Asia" and computer engineer. But I require that String in double quotes should be a single token. How to achieve this using StringTokenizer class? Or is there any other way?
Thanks in advance.Try
String[] str="abc,\" India, Asia\",computer engineer".split(",",1);
for(String s: str)
System.out.println(s);
}Thanks. -
PL/SQL: quoting problems (double quotes within PL/SQL, howto?)
Hello,
I have a big problem with that: I just cannot use execute immediate to do what I want.
The goal is that another user than sysdba needs to be able to open/close the wallet (we are sysdba and our client doesn't want us to be able to open the wallet, and we don't want the client to have sysdba), so I take advantage of the fact that procedures are executed by default with the privileges of the user which writes it. So, I try and create a PL/SQL procedure as sys and grant execute rights to the client user.
To open/close a wallet, the command is:
alter system set encryption wallet open/close identified by "thepasshere";
Note the double quotes... They are the problem here (passwords are mixed case and contain special characters). Right now, the only solution I came up with is:
create or replace procedure open_wallet (passwd in varchar2) is
begin
execute immediate 'alter system set encryption wallet open identified by "' || passwd || '";';
end;
But that's vulnerable to code injection... So, instead, I tried:
create or replace procedure open_wallet (passwd in varchar2) is
cmd varchar2(512);
begin
cmd != 'alter system set encryption wallet open identified by ":1"';
execute immediate cmd using passwd;
end;
which yields "ORA-00911: invalid character" - uh?
Now, if I try:
create or replace procedure open_wallet (passwd in varchar2) is
cmd varchar(512);
begin
cmd := 'alter system set encryption wallet open identified by :1;';
execute immediate cmd using passwd;
end;
it answers "ORA-28357: password required to open the wallet"
Aaargh! I see no way around that :(
Is there a solution at all?Did you try including the double quotes in the password bind value? Either when you pass the value in or by adding it in the routine.
create or replace procedure open_wallet (passwd in varchar2) is
cmd varchar(512);
pass varchar(512);
begin
cmd := 'alter system set encryption wallet open identified by :1;';
pass := '"' || passwd || '"';
execute immediate cmd using pass;
end; -
Regarding Double Quotes [Javascript] problem
Hi,
In a BSP application I have a field with F4 help (Popup Page).
F4 Help Page contain search fields and results in tableView, each cell
in tableView is rendered using htmlb_link controller. In event
onclientclick of the htmlb_link I'm using a Javascript method for
passing data back to the calling window.
CONCATENATE 'passDataBack("' browner_id '", "' browner_text '")' INTO
lorv_link->onclientclick.
JavaScript Method has the following body.
function passDataBack(browner_id, browner_text )
window.opener.document.getElementById("
<%= controller->mv_js_browner_id %> ").value = browner_id;
<U>window.opener.document.getElementById("
<%= controller->mv_js_browner_text %> ").value = browner_text;
IF the data browner_text contain text with double quotes, then I'm
getting Java Script error. I tried encoding the string, double Quote are
converted to " but still, the Java script error is showing.
Please suggest a solution.
Thanks & Regards
Geogytry this
CONCATENATE `passDataBack('` browner_id `', '` browner_text `' )` INTO
lorv_link->onclientclick. -
Problem on getting output in Double quotes in XSD?
hi friends,
I have an issue on Transform activity. When we concat three elements of source side to target side element. Then the result of target side element will be displayed in double Quotes.
Hope any one can help to solve this issue.
Thanks in Advance,In order for anyone to provide an answer, they would need to see what you are doing. A test case and/or some sample code is always appreciated, along with any other relevant details in regards to someone being able to duplicate your issue.
-
Problem with SQL statement - Missing double quote in identifier
Hi
I am unable to run the following query in TOAD.
SELECT A.* FROM (SELECT VC.CAMPAIGN_NUMBER," +
"VC.CAMPAIGN_TITLE,VC.CAMPAIGN_DESC,VC.START_DATE,VC.END_DATE,VC.CAMPAIGN_TYPE,VC.APPLICABILITY," +
"VC.CAMPAIGN_PRIORITY FROM VM_CAMPAIGN VC WHERE VC.APPLICABILITY = 'Y' and VC.COUNTRY_CODE = ? " +
"and VC.LANGUAGE_CODE = ? AND VC.CAMPAIGN_TYPE = ? AND SYSDATE BETWEEN VC.START_DATE AND " +
"VC.END_DATE AND NOT EXISTS (SELECT 'X' FROM VM_CAMPAIGN_VIN VCV WHERE (VCV.VIN = ? AND " +
"VCV.CAMPAIGN_NUMBER = VC.CAMPAIGN_NUMBER))UNION SELECT VC.CAMPAIGN_NUMBER,VC.CAMPAIGN_TITLE," +
"VC.CAMPAIGN_DESC,VCV.START_DATE,VCV.END_DATE,VC.CAMPAIGN_TYPE,VC.APPLICABILITY,VC.CAMPAIGN_PRIORITY " +
"FROM VM_CAMPAIGN_VIN VCV ,VM_CAMPAIGN VC WHERE VCV.VIN = ? AND " +
"VCV.CAMPAIGN_NUMBER = VC.CAMPAIGN_NUMBER AND VC.COUNTRY_CODE = ? AND VC.LANGUAGE_CODE = ? AND " +
"VC.CAMPAIGN_TYPE = ? AND SYSDATE BETWEEN VCV.START_DATE AND VCV.END_DATE AND SYSDATE BETWEEN " +
"VC.START_DATE AND VC.END_DATE) A ORDER BY A.CAMPAIGN_PRIORITY DESC, A.END_DATE
I am getting "Missing double quote in identifier"
I am not sure how to rectify this SQL code. Any suggestions are welcome
thanks in advancemaybe this will work.
SELECT A.*
FROM (SELECT VC.CAMPAIGN_NUMBER,
VC.CAMPAIGN_TITLE,
VC.CAMPAIGN_DESC,
VC.START_DATE,
VC.END_DATE,
VC.CAMPAIGN_TYPE,VC.APPLICABILITY,
VC.CAMPAIGN_PRIORITY
FROM VM_CAMPAIGN VC
WHERE VC.APPLICABILITY = 'Y'
And VC.COUNTRY_CODE = '&country_code'
And VC.LANGUAGE_CODE = '&language_code'
AND VC.CAMPAIGN_TYPE = '&campaign_type'
AND SYSDATE BETWEEN VC.START_DATE AND VC.END_DATE
AND NOT EXISTS (SELECT 'X'
FROM VM_CAMPAIGN_VIN VCV
WHERE (VCV.VIN = &VIN AND
VCV.CAMPAIGN_NUMBER = VC.CAMPAIGN_NUMBER))
UNION
SELECT VC.CAMPAIGN_NUMBER,
VC.CAMPAIGN_TITLE,
VC.CAMPAIGN_DESC,
VCV.START_DATE,
VCV.END_DATE,
VC.CAMPAIGN_TYPE,
VC.APPLICABILITY,
VC.CAMPAIGN_PRIORITY
FROM VM_CAMPAIGN_VIN VCV,
VM_CAMPAIGN VC
WHERE VCV.VIN = &VIN
AND VCV.CAMPAIGN_NUMBER = VC.CAMPAIGN_NUMBER
AND VC.COUNTRY_CODE = '&country_code'
AND VC.LANGUAGE_CODE = '&language_code'
AND VC.CAMPAIGN_TYPE = '&campaign_type'
AND SYSDATE BETWEEN VCV.START_DATE AND VCV.END_DATE
AND SYSDATE BETWEEN VC.START_DATE AND VC.END_DATE) A
ORDER BY A.CAMPAIGN_PRIORITY DESC, A.END_DATE -
I am trying to pass in a calc script string from a Perl script to a MaxL script. The calc script needs double quotes around some of the member names (yes, I know I can create aliases with underscores to work around this, but I can't believe this isn't possible). I can escape the double quote characters in Perl, no problem. But the double quotes just get stripped by MaxL. Here is an example:<BR><BR>MAXL> echo 'I am "quoting" this';<BR><BR>I am "quoting" this<BR><BR>MAXL> set X = 'I am "quoting" this';<BR><BR>MAXL> echo $X;<BR><BR>I am quoting this<BR><BR>MAXL><BR><BR>There is nothing in the docs about escaping double quote characters. I've tried using backslash, no luck there. I've tried using double double quotes and they all get stripped. I've tried doing this inside single quoted strings and double quoted strings - no joy whatsoever. The funny thing is the example above, where simply echoing the literal string works, but assigning it to a variable strips out the double quotes.<BR><BR>Does anyone know how to get double quotes into a MaxL string variable? There has to be a way...<BR><BR>Thanks,<BR><BR>James
Yes, I've dealt with enclosing variables in double quotes in order for MaxL to parse them properly, but what I'm trying to do is use a variable that contains a double quote. Such as:<BR><BR> set QuoteVar = 'I am "quoting" this';<BR><BR>I'm trying to set substitution variables via MaxL, and some of my existing sub vars have double quotes in them so that they can be used to store member names that appear in calc scripts. As I said, I know I can accomplish this with an alias table that creates a version of the member name that doesn't need quotes, but that's a whole deal to maintain just for this one thing and it seems overly burdensome for such a simple task.<BR><BR>Also, as I said, MaxL does fine with double quotes in literal strings, it's only when assigned to variables that it always strips them out. I want to create a relatively generic script for setting sub vars, so I need to pass variables around. Just calling MaxL from Perl and passing in parameters that get converted to $1, $2, etc. causes these double quotes to get stripped.<BR><BR>So, is there any way around this?<BR><BR>Thanks,<BR><BR>James
-
Need Double quotes instead of Single quotes in output XML version header
In XML output generated by XDODTEXE executable, its observed that header row looks like this:
<?xml version = '1.0' encoding = 'UTF-8'?>
It should look like this:
<?xml version="1.0" encoding="UTF-8"?>
Browsers like IE deceive. Opening the XML in Text editors show single quotes and spaces.
Data Template and XSL template files have proper headers with double quotes.
The output XML file is rejected by a Government Authority as parsing the header line fails.
Are there any ways to configure this?I dont know if this has anything to do with my problem or not, but I thought I should add this:
When a user is filling out the form that has the textarea, they put whatever text they want into the textarea field.
textarea name="text"></textarea
Then, they click on a 'Continue' button and the system shows them a preview of what they are about to have inserted
into the database.
Within the code on this preview page is a hidden field, which holds the contents of their textarea data so it can be
passed on through the process once the user verifies the preview.
This is done using this: input type="hidden" name="text" value="<cfoutput>#text#</cfoutput>"
Like I said, I don't know if that has anything to do with this problem, but thought it might be good to mention it
Kudos -
Special double quotes and apostrophes in java help
We are writing help for an application and using doctor help to generate it. The help is written in Word and converted to html. Word however, converts all the " characters to those "squiggly ones" which point towards the word they're quoting.
When we viewed the generated help with java help those squiggly were not rendered. They are rendered as a square which means java help does not understand them.
I'm sure someone else must have encountered this issue.
Please can you tell me how to successfully render the squiggly double quotes in java help?You need the following encoding for those characters:
“
”
using an xml encoder, e.g. xmlenc solves this issue, otherwise you must do it manually.
But I have a related problem. When characters in the XML file are encoded
they are only displayed correctly if some non encoded character follows.
When there are two successive encoded characters then only the first one
is displayed correctly. Putting a whitespace in between them displays both
characters correctly, but with the whitespace in between.
I guess there is an issue with the XML parser. Changing the encoding of the XML file does not help.
example: TOC.xml file (displayed correctly in IE)
<?xml version='1.0' encoding='ISO-8859-9' standalone='yes' ?>
<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN" "http://java.sun.com/products/javahelp/toc_1_0.dtd"><!--generated by JHelpDev Version: 0.4, 18 August 2005, see jhelpdev.sourceforge.net-->
<toc version="1.0">
<tocitem text="images "/>
<tocitem text="ĞĞRENCİ MODÜLÜ " target="index"/>
</toc>
Any ideas? -
Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value
Hello forums,
I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope. Let me explain what I want to do and the difficulty that I'm having:
I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog. What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot. The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like. The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide. This action script works fine for the first two input options, but I can't make it work for the third search option.
I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue. Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
Thank you for your time and consideration.
Andrew Wilk
College Library
UW-MadisonThe tutorial is for a "how to use catalog searching" instruction in an undergraduate library session. We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep." Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested. Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
Thank you for all your suggestions -
Extracting data in .txt which is enclosed in double quote," "
Hello everyone,
I am trying to read data from a .txt file which look like below.
"13.000000,393.000000 13.000000,291.000000 92.000000,284.000000 94.000000,380.000000 64.000000,385.000000 13.000000,388.000000 "The problem is every time i tried to read and save the data, i also save the double quote sign. Is there anyway to ignore the double quote sign? I am using the below coding to read and save the data in double array. Anyway will be great.
FileReader fread=null;
BufferedReader bread = new BufferedReader(new FileReader("test1.txt"));
java.io.File file=new java.io.File("test1.txt");
java.util.Scanner input=new java.util.Scanner(file);
while(input.hasNext()){
String arr=bread.readLine();
String[][] str = buildArray(arr);veldhanas wrote:
Hi,
String yourString = bread.readLine();
String substring = yourString.substring(1,yourString.length()-1);
System.out.println(substring);
[See the String class |http://java.sun.com/javase/6/docs/api/java/lang/String.html]
ThanksWatch out for those empty lines... -
XSD OTD compilefailure String literal not properly closed by double-quote
Java CAPS 5.1.3
I have created a XSD to describe a simple XML file. After this I created an OTD from the exported XSD file.
This OTD is being used in a JCD. During the build of the Deployment Profile I get the error: :Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
All steps have been preferformed within the same eDesigner and the same repository.
I have verified the XSD file with netbeans and can not see a problem with the file itself.
Any ideas to resolve this compile failure?
The XSD is:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1" targetNamespace="http://ams1saa011:12000/repository/repository/Recieve/MessageBroker/WISE_WTE/repository1423024:117d46f486a:-8000/XSDDefinition1">
<xsd:element name="MessageBroker">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="IN" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<xsd:element name="MSGFN" type="xsd:string" default="IN"/>
<xsd:element name="DIR" type="xsd:string" default="\"/>
<xsd:element name="FILEMASK"
type="xsd:string" default="*.DAT"/>
<xsd:element name="MAPID" type="xsd:string" default="MS000"/>
<xsd:element name="RCVPRN" type="xsd:string"/>
<xsd:element name="RCVPRT" type="xsd:string"/>
<xsd:element name="RCVPFC" type="xsd:string"/>
<xsd:element name="SNDPRN" type="xsd:string"/>
<xsd:element name="SNDPRT" type="xsd:string"/>
<xsd:element name="MESTYP" type="xsd:string"/>
<xsd:element name="MESCOD" type="xsd:string"/>
<xsd:element name="MESFCT" type="xsd:string"/>
<xsd:element name="TEST" type="xsd:boolean" nillable="true"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="dateTime" type="xsd:dateTime"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>The complete error stack trace is:
com.stc.codegen.framework.model.CodeGenException: error generating otd for CMap1_jcdMB_Recieve_SAP_Inbound1:Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:767)
at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.processCodelets(CodeGenFrameworkImpl.java:653)
at com.stc.codegen.frameworkImpl.model.CodeGenFrameworkImpl.process(CodeGenFrameworkImpl.java:1544)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:405)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.process(DeploymentVisitorImpl.java:308)
at com.stc.codegen.frameworkImpl.model.DeploymentVisitorImpl.traverseDeployment(DeploymentVisitorImpl.java:268)
at com.stc.codegen.driver.module.DeploymentBuildAction.loadCodeGen(DeploymentBuildAction.java:923)
at com.stc.codegen.driver.module.DeploymentBuildAction.access$1000(DeploymentBuildAction.java:174)
at com.stc.codegen.driver.module.DeploymentBuildAction$1.run(DeploymentBuildAction.java:599)
at org.openide.util.Task.run(Task.java:136)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
Caused by: java.lang.RuntimeException: Compile failed: xsd.XSD_MB235401907.X_all_B: Line 69: String literal is not properly closed by a double-quote
at com.stc.javac.Javac.compile(Javac.java:227)
at com.stc.otd.codegen.BaseXsdDtdGenerator.compileFromJarfile(BaseXsdDtdGenerator.java:254)
at com.stc.otd.codegen.BaseXsdDtdGenerator.compile(BaseXsdDtdGenerator.java:52)
at com.stc.otd.xsd.codegen.XsdParserGenerator.compile(XsdParserGenerator.java:182)
at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:166)
at com.stc.otd.codegen.BaseXsdDtdGenerator.generate(BaseXsdDtdGenerator.java:90)
at com.stc.codegen.OTDImpl.model.CollabOTDGenerator.generateCollabOTDJavaFiles(CollabOTDGenerator.java:233)
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.processOTDJars(OTDCodeletFactory.java:861)
at com.stc.codegen.OTDImpl.model.OTDCodeletFactory$OTDCodelet.postFileGeneration(OTDCodeletFactory.java:666)
... 10 moreYou may need to escape the default slash "\\".
I'd suggest importing the xsd into the jcaps xml schema editor and verifying that way and then creating the otd by node export.
Regards,
Rupert -
How to replace single quote with double quote
hai all,
i have a problem,
i am trying insert a string containing single quote into ms-access database.
it is giving error.
how can i avoid this .if i replace a single quote in the text with double quote it will defenitely
insert into database.
in java.lang.String
replace () will not work to replace quote with double quote.
any otherway to solve this problem.
please mail me to [email protected]
thank you
sambareddy
inidajava.lang.String.replace () will not work to replace quote with double quote.Really?
String x = ...
x.replace( "'", "\"" ); -
Replacing " (double quote) with ' (single quote)
Hi there,
I have the following method to manipulate user input. All I want to do is, to replace the double quote with a single quote. The implementation I tried was,
this.replace(desc, "\"", "'");
This does not work for me. It jsut removes the double quote and does not introduces the single quote. Could any one please advise?
Thanks,
Des
public static String replace(String line, String oldString, String newString) {
if(line != null && oldString != null && newString != null) {
int index = 0;
while ((index = line.indexOf(oldString, index)) >= 0) {
line = line.substring(0, index) +
newString +
line.substring(index + oldString.length());
index += newString.length();
return line;
}Bad luck.. I am unable to get it still.
This is the code I am using (implemetation is in a JSP. I am using this code to test it).
public class Test{
public static void main(String args[]){
String s = args[0];
Test t = new Test();
String doubleQuote = "\"";
System.out.println(" output :"+ t.replace(s,doubleQuote,"'"));
//System.out.println(" output :"+ t.replace(s,"\"","'"));
//System.out.println(" output :"+ t.replace('"', '\''));
public static String replace(String line, String oldString, String newString) {
if(line != null && oldString != null && newString != null) {
int index = 0;
while ((index = line.indexOf(oldString, index)) >= 0) {
System.out.println(" line count :");
line = line.substring(0, index) +
newString +
line.substring(index + oldString.length());
index += newString.length();
return line;
}mshn02
The main problem is I am stuck with the server's version of Java (which I have no control on it). I could not use 1.4.2
Maybe you are looking for
-
1/ plug in my iphone 4S (iOS 6.1.3) unlocked to PC (window 7) 2/ window explorer open and see "Apple iPhone" icon and clicked 3/ see internal storage icon telling me GBs of ize used 4/ click in and see DCIM folder 5/ double click and nothing inside c
-
How can I access my project files without iTunes on an iPad 2 (non-jB)
The other day while I was using the device, it just reset itself and decided I needed to activate it again. When I try to do this I get a message saying the "device is not part of the developer program..." and I have tried removing it's UDID from the
-
Installing PrE10 on a new laptop
So my laptop crashed, and I ended up getting another laptop. Can I download and install on it PrE10 since I won't be using the machine it was installed on originally? Both systems would support it. I imagine one cannot run PrE10 on two laptops at
-
Mail crashes every 20 seconds after updating to 10.10.2.
This morning i installed the update 10.10.2. for OS X Yosemite, after this update my mail dent work anymore..... every 20-30 seconds it hangs and i should force it to close the program........ Would like to know how to uninstall this ****** update. I
-
Preview shows different content in thumbnail drawer and main windows ?
hi, i've got a few pictures that were apparently cropped - Preview shows the cropped version in the main viewer window, but shows the pre-cropped version in the thumbnail drawer. anyone know why this is? and if there is any way to "revert" the croppe