redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

how to replace characters in a string


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
How do i replace all character 'ы' with 'u' in a String?
Str.replace('ы', 'u');
Does nothing..
  Reply with quote


WarChild



Joined: 24 Feb 2006
Posts: 46
Show us the code of the failing test.
  Reply with quote
PaulKolin



Joined: 25 May 2006
Posts: 108
Does nothingпјџ
Paste your code
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
autos, you cannot change a String.
  Reply with quote
PaulKolin



Joined: 25 May 2006
Posts: 108
Str = str.replace
  Reply with quote
plantino



Joined: 13 May 2006
Posts: 96
Doesn't 'replace()" return a new string?
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
Ah..
  Reply with quote
Mupolan



Joined: 30 May 2006
Posts: 101
String s = myString.replaceAll('ы', 'u');
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
I dont understand this:
Java.io.IOException: Server returned HTTP response code: 400 for URL: http://blablabla/
The url looks fine to me:s
  Reply with quote
optomeb



Joined: 19 May 2006
Posts: 113
Maybe the space characters need to be escaped
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
But other urls that looks the same work..
Hmm i see the problem
  Reply with quote


Klimapol



Joined: 27 May 2006
Posts: 134
HS^, space, the final frontier.
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
How do i escape a space?
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
%20
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
I the browser it puts %20 or something
Ok
I just replace spaces wiht %20
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
~javadoc URLEncoder
  Reply with quote
montanarry



Joined: 13 May 2006
Posts: 175
Klimapol, please see java.net.URLEncoder: http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLEncoder.html
  Reply with quote
Poolkop



Joined: 01 Jun 2006
Posts: 123
You can use either %20 or +
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
"The space character " " is converted into a plus sign "+". "
Ok
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
Poolkop, I forget that. ;)
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
It also encodes: в
Chars like that?
  Reply with quote


Klimapol



Joined: 27 May 2006
Posts: 134
HS^, did you type some non-ASCII then?
  Reply with quote
Poolkop



Joined: 01 Jun 2006
Posts: 123
HS^, urls are only ascii
if you try to put anything non-ascii into an url you need to encode it...
and then you start having problems...
  Reply with quote
autos06



Joined: 13 May 2006
Posts: 123
Location: New York
Yes but will so will URLEncoder replace non-ascii ?
  Reply with quote
Poolkop



Joined: 01 Jun 2006
Posts: 123
HS^: since there is no standard how you encode non-ascii characters... (utf-8? latin-1? <other encoding>?)
  Reply with quote
Page 1 of 2 Goto page 1, 2  Next
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group