home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2682
Discussions: 186,606, Posts: 2,227,046, Members: 230,241
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old August 26th, 2008, 04:26 AM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Jul 2006
Posts: 23
Cool
Java replace method

Hi everyone.

I found a java code but can't figure out how it works. Here is the code.

package samp;

public class ReplaceMethod
{

public static void main(String[] args)
{
String dummyFileDirectory = "C:\\Rod\\Anime\\Episodes\\Naruto";
String modifiedDirectory = "";

System.out.println("dummyFileDirectory: " + dummyFileDirectory);

modifiedDirectory = (char)34 + dummyFileDirectory.replace( "\\", "\\\\" ).replace( "\"", "\\\"" )
+ (char)34;

System.out.println("\n" + "modifiedDirectory: " + modifiedDirectory);

}
}

I don't know what happened to 34.

rodkun is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old August 26th, 2008, 04:27 AM     #2 (permalink)
Junior Member
 
Join Date: Jul 2006
Posts: 23
Here is the result when executed.

*************************************

dummyFileDirectory: C:\Rod\Anime\Episodes\Naruto

modifiedDirectory: "C:\\Rod\\Anime\\Episodes\\Naruto"

*******************************************

rodkun is offline   Reply With Quote
Old August 27th, 2008, 01:12 AM     #3 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,540
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
What do you mean you can't figure out how it works?
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.

jkrohn is online now   Reply With Quote
Old September 1st, 2008, 03:36 AM     #4 (permalink)
Junior Member
 
Join Date: Jul 2006
Posts: 23
(char)34

I don't know what the (char)34 is used for. Even when the results are displayed it is not there. What happened to (char)34?
rodkun is offline   Reply With Quote
Old September 1st, 2008, 09:51 AM     #5 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,540
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
(char)34 inserts a " into the string
jkrohn is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching Java webpages with different Java settings? LostBok Webmastering and Programming 1 December 11th, 2006 03:38 AM
which method should I use to repair? Omega Man Applications and Operating Systems 4 December 28th, 2005 03:44 PM
Replace KT133MB, processor & memory or just replace nForce2MB? videobruce Motherboards 2 January 6th, 2005 11:17 AM
Call a java method from VB project?!?!!? Possible or not? gicio Webmastering and Programming 2 December 2nd, 2002 09:36 PM
oh no! New method of spam?! voogru Networking and Internet 7 November 19th, 2002 08:45 AM

Most Active Discussions
Is It Just Me? (528)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (18)
heatsink issue (10)
New Mobo (18)
UPGRADING C/D DRIVE TO 250GB & .. (14)
SSD's, RAID, and External Backup (7)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
Recent Discussions
firewall (1)
C++ compiler suggestions (4)
Official World of Warcraft Thre.. (4529)
Programming question (2)
UPGRADING C/D DRIVE TO 250GB &a.. (14)
Ubuntu or Xubuntu....anyone!!? (7)
Building my first PC and need s.. (0)
PNY vs Gainward (3)
Linksys WRT54G (2)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 11:53 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28