Forums Register Login

substring

+Pie Number of slices to send: Send
i have EMP database in a field history contains 500 charactes.
i want to display first 125 characters
How to do this using Java?
+Pie Number of slices to send: Send
Hi,

public class DemoDisplay {

public static void main(String[] args) {
// Let this be the output String retrieved from the database EMP
String word = "123456789";
int worldLenght = word.length();
int end = worldLenght - (worldLenght - 3);
// Would retieve the first 3 characters of the String word.
String sub = word.substring(0, end);
System.out.println("sub :: " + sub);
}
}

I hope this helps you ......

With Regards,
Ravi.
+Pie Number of slices to send: Send
thanks very much
I knew I would regret that burrito. But this tiny ad has never caused regrets:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1020 times.
Similar Threads
extract values
substring manipulation
Query
Pagination using the database(DB2)
Truncate and display only specific character length
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:56:05.