I am trying to find the Character of an index of a string. The reason I am doing this is because I would like to break up a string. lets say every 5th space… " " I would like to replace with a break. Because I can not find a width and text wrap with a text mesh.
Any ideas?
I have been looking at this JavaScript String charAt() Method
ans so I have started to write something like this to test if it would insert the *
private var myComment : TextMesh;
function Awake(){
myComment= GetComponent(TextMesh);
}
function Start(){
AssignComment("This is some cool text because it is very long and I love it. you love it? yes you love it , its just great to have such a long commnet. ");
}
function AssignComment(incComment : String){
var SeperatedString : String = incComment;
var CommentLength : int = incComment.length;
for(var i : int = 0; i< CommentLength; i+=20)
for(var b : int = 0; b<20; b++)
if(incComment.charAt(i+b)==" ")
{
SeperatedString.Replace(SeperatedString.charAt(i+b),"*");
b=20;
}
myComment.text = SeperatedString;
}