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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -