java - What's the StringBuffer alternative for String.endsWith? -
i have been using string in concurrent application , make code more optimized,i have use stringbuffer instead of string? confused alternative of string.endswith("\\") stringbuffer. method of stringbuffer should used mentioned purpose?
there no direct api. try try stringbuffer.lastindexof("\\")==stringbuffer.length()-1
or
stringbuffer.charat(stringbuffer.length()-1)=='\\'
ps : above code samples untested.
Comments
Post a Comment