str = str.replace(”find”,”replace”)
To ReplaceAll you have to do it a little differently. To replace all occurrences in the string, use the g modifier like this:
str = str.replace(/find/g,”replace”)
My Knowledges
str = str.replace(”find”,”replace”)
str = str.replace(/find/g,”replace”)
InetSocketAddress socketAddr = new InetSocketAddress(url,port);
Socket socket = new Socket();
socket.connect(socketAddr,readTimeout);
socket.setSoTimeout(idealTimeout);
// Open a socket without any parameters. It hasn’t been binded or connected
Socket sock = new Socket();
// Bind to a local ephemeral port
sock.bind(null);
// Connect to google.com on port 80 with a timeout of 500 milliseconds
sock.connect(new InetSocketAddress(”www.google.com”, 80), 500);
// Your code goes here
// Close the socket.
sock.close();
Copyright © 2009 My Knowledges
Design by Design Disease for Smashing Magazine | Blogger Templates by Blog and Web