Results 1 to 4 of 4
- 03-25-2011, 06:20 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
replacing last char of string logics
hi all,
i need to replace the last char of string by a ")"
i did this..
and my manager wants something else other than (query.length -1)!!Java Code:query = query.substring(0,query.length()-1)+")";
what cud be the other way around which is better than this.
this is the complete code list:
Java Code:query+="SELECT EXTID , REPLACE(ICI_ID, ' ', '') ICI_ID, CPY_SID, LINE_NUMBER"; query+=" FROM TEMP_OTC_CSA_ID, COUNTERPARTY"; query+=" WHERE REPLACE(ICI_ID, ' ', '') IN (EXTERNAL_ID,BIC_CODE)"; query+=" AND SOURCE_ID IN ("; String cpySrc[] = cpySource.split("\\,"); for(int i=0; i<cpySrc.length; i++){ query+= "'"+cpySrc[i]+"',"; } query = query.substring(0,query.length()-1)+")"; query+=" ORDER BY LINE_NUMBER, EXTID";
- 03-25-2011, 06:45 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Maybe he wants you to use charAt.
- 03-25-2011, 07:16 AM #3
The word is teachermy manager wants something else
db
- 03-25-2011, 09:30 AM #4
Member
- Join Date
- Dec 2010
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Replacing a char with the next
By hiei_yasha in forum New To JavaReplies: 14Last Post: 01-15-2011, 02:12 AM -
check a string char by char
By Sotsiak in forum New To JavaReplies: 2Last Post: 10-23-2010, 09:24 PM -
Replacing char in string help
By jimmy-lin in forum New To JavaReplies: 3Last Post: 10-12-2009, 06:01 AM -
Replacing the chars within a string.
By Mayur in forum New To JavaReplies: 2Last Post: 03-27-2009, 04:00 AM -
Help Replacing String
By 7oclock in forum New To JavaReplies: 5Last Post: 02-14-2009, 07:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks