I want to split a string after a certain length.
Let's say we have a string of "message"
Who Framed Roger Rabbit
Split like this :
"Who Framed" " Roger Rab" "bit"
And I want to split when the "message" variable is more than 10.
my current split code :
private void sendMessage(String message){
// some other code ..
String dtype = "D";
int length = message.length();
String[] result = message.split("(?>10)");
for (int x=0; x < result.length; x++)
{
System.out.println(dtype + "-" + length + "-" + result[x]); // this will also display the strd string
}
// some other code ..
}