[Áú¹®]¹®ÀÚ¿­ ġȯÀº ¾î¶»°Ô Çմϱî?


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :À̽¹è 2000³â 2¿ù 14ÀÏ 18:05:08

In Reply to: [Áú¹®]¹®ÀÚ¿­ ġȯÀº ¾î¶»°Ô Çմϱî? posted by Kim-jinwoo on 2000³â 2¿ù 14ÀÏ 15:21:37:

¼Ò½º¸¦ ÷ºÎÇÕ´Ï´Ù.


//ÀÌ ¸Þ¼Òµå´Â ¹®ÀÚ¿­ ³»ÀÇ Æ¯Á¤ ¹®ÀÚ¿­À» ġȯÇÒ¶§ ¾²ÀδÙ
//source: ¿øº» ¹®ÀÚ¿­
//oldStr: ¿øº» ¹®ÀÚ¿­Áß ¹Ù²Ü ¹®ÀÚ¿­
//newStr: ´ëÄ¡µÇ´Â ¹®ÀÚ¿­
public static String castString(String source, String oldStr, String newStr)
{
String temp;
String destString = "";
int pos = 0;


while((pos = source.indexOf(oldStr)) != -1)
{
temp = source.substring(0, pos);
source = source.substring(pos + oldStr.length(), source.length());
destString = destString + temp + newStr;
}
destString = destString + source;
return destString;
}


´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]