1

How do I insert a space/carriage return after a designated number of characters (eight) within a designated html field pulling from a table?

Example:

<ebs:PMLOAD TABLE='DS_CLAIM'><ebs:PMVAL FIELD='DS_CLAIM.CGROUPING_FIELD'></ebs:PMVAL></ebs:PMLOAD>

So if the field contains 12345678910, the output would read:

12345678
910
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

2 Answers2

0

With HTML you don't. JavaScript is the handler, Using replace method.

str = "1234567890";
alert(str.replace(/^(.{8})(.*)$/mg,'\1 \2'));
0
var arr = string.split(""), output;
arr.splice(8, 0, ' ');
output = arr.join('');
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405