Code example for Editable

Methods: replace

0
		data = getText().toString();
		if(data.split("\n").length > maxLines)
		{ 
			data = data.substring(data.indexOf("\n") + 1);
			// Replace all text with the same text minus the first line 
			s.replace(0, length(), data);
		} 
	} 
 
	public void beforeTextChanged(CharSequence s, int start, int count, int after)
	{ 
		// Not used 
	} 
 
	public void onTextChanged(CharSequence s, int start, int before, int count)
	{ 
		// Not used 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java