473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

help with replace "" with " " in a string

helo all

i have a string blablabla""blabla"" i want to make a space between two double qoates like blablabla" "blabla" "

how can i do it in java .. i use replaceAll function but i can't find thw way to do that.
Jan 18 '08 #1
3 2010
Ganon11
3,652 Expert 2GB
You can use the .find operator to find an occurrence of "", then use concatenation to add the space character.
Jan 18 '08 #2
You can use the .find operator to find an occurrence of "", then use concatenation to add the space character.

i found an alternative method ...
but thanks anyway
Jan 18 '08 #3
BigDaddyLH
1,216 Expert 1GB
If you do not need to use proper regexes -- if you are doing a straight substring replacement -- prefer String method replace over replaceAll.

String.replace API

Despite its name, replace does replace all occurrences of the first argument with the second:
Expand|Select|Wrap|Line Numbers
  1. String result = s.replace("\"\"", "\" \"");
The only tricky thing in this example is to remember to escape the double quote, since it is a delimiter.
Jan 18 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: ajikoe | last post by:
Hello, I would like to replace string with different values, For example : source = 'kode1 bla bla kode1 bla kode1' I have a list with each member will replace each of kode1. L = So the new...
6
by: vigi98 | last post by:
Hello all, Can someone confirme that this: var strURLpiece = "UK & Ireland"; strURLpiece.replace("&", "%26"); replaces all occurrence of the character & by %26 in strURLpiece, ie that...
3
by: asd987 | last post by:
Hi, Can anyone tell me if "replace" is supported by Access 97? I use the Dutch version and get the errormessage "sub or function not supported". Or is the Professional Edition needed? Thanks.
1
by: Neil Zanella | last post by:
Hello, The MSDN documentation does not seem to mention whether the Replace string method returns a new string or modifies the existing string in place and then returns it. I would like to know...
2
by: ad | last post by:
Hello, if I try this ((StringBuilder)sb).Replace("a", "aa"); I get OutOfMemoryException raised if sb contains at least one "a"... It seems like StringBuilder 'seeker' doesn't move to the end...
2
by: Dmitriy Kolesnik | last post by:
Hello, all! I don't know how I can replace specified string in the txt-file from one to another. Thank You. -- __________________
6
by: Marty | last post by:
Hi, I would like to replace "\r\n" by "_" within a specific string. I tried : strMyString.Replace('\r', '_'); strMyString.Replace('\n', '_'); or...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
2
by: John Nagle | last post by:
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File...
3
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.