energy
December 3rd, 2008, 11:49 AM
Hey Guys,
I am trying to add "Newline" before and after beginning of every lesson.
Suppose Input is
var str:String = "Lesson 1 Jobmatching." + "\n" + "This is Job Matching Lesson text" + "\n"+ "Do you know this." + "\n" +"Lesson 2 Basics of FlashDesign." + "\n" + "This is Basics of Flash Design Lesson Text";
Now when you trace str, it will be this.
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So i have already written a regular expression which matches this text
var pattern:RegExp = /Lesson+ ([0-9]+) ([a-z]+)*./
Looks Correct...isn't it.
Now I have tried "str.replace"...."str.match" etc but couldn't get the desired output.
This is the output i am looking for:
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So how can i achieve this.Any thoughts?
Thanks.
I am trying to add "Newline" before and after beginning of every lesson.
Suppose Input is
var str:String = "Lesson 1 Jobmatching." + "\n" + "This is Job Matching Lesson text" + "\n"+ "Do you know this." + "\n" +"Lesson 2 Basics of FlashDesign." + "\n" + "This is Basics of Flash Design Lesson Text";
Now when you trace str, it will be this.
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So i have already written a regular expression which matches this text
var pattern:RegExp = /Lesson+ ([0-9]+) ([a-z]+)*./
Looks Correct...isn't it.
Now I have tried "str.replace"...."str.match" etc but couldn't get the desired output.
This is the output i am looking for:
Lesson 1 Jobmatching.
This is Job Matching Lesson text
Do you know this.
Lesson 2 Basics of FlashDesign.
This is Basics of Flash Design Lesson Text
So how can i achieve this.Any thoughts?
Thanks.