angyalhentes Creative Commons License 2002.11.11 0 0 394
Hulye dolog, de ilyen metodusa a StringBuffernek valamiert nincs. Illetve nem az a hulye dolog, hanem az, hogy a Stringnek viszont van.

public String replace( char oldChar, char newChar );

de szerintem egyszerubb, ha azt csinalod, hogy:

for( int i = 0; i < sb.length(); i++ )
{
  if( sb.charAt( i ) == oldChar )
    sb.setCharAt( i, newChar );
}

(Ezzel szemben baromi fontos am a StringBuffer-be a reverse() metodus, bah. Most jol kidohogtam magam :))

Előzmény: MandrakeFun (393)