0

I need to create a String variable . that should be like following variable.

String search = "xmlns="http://tempuri.org/" />";

but I cannot assign xmlns="http://tempuri.org/" /> directly into a String variable because tempuri.org/" />"; get commented automatically.

I need a format this string and finally variable should be like this

search = xmlns="http://tempuri.org/" /> ;

How can I achieve this ?

1

2 Answers 2

2

You need to use escape characters:

String search = "xmlns=\"http://tempuri.org/\" />";

Version from the comments:

String search = "xmlns=\"tempuri.org/\"; /></soap:Body>";
Sign up to request clarification or add additional context in comments.

1 Comment

Actually I need following String assign to a variable. Could you please modify the answer according to this xmlns="tempuri.org" /></soap:Body>
1

You have to escape the special chars i.e replace the " for \"

String search = "xmlns=\"http://tempuri.org/\" />";

1 Comment

Actually I need following String assign to a variable. Could you please modify the answer according to this,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.