I have a Long string from that I want to store the keyword in array or collection, the format of my string is like below:
Title: My Test Page Title.
Desc: My page description.
Keywords: Bessel function, legendre function, Differential Equations, Bessel, Legendre, Homogenous, Assignment & Maths Homework Help.
Bessel & Legendre Function:
Homogenous Equations of the second order of the type
+ x + ( – )y = 0, v [0, ), x [0, )………………….(1)
(1 – ) – 2x + n (n + 1)y = 0, n = 1, 2 ……, x (-1, 1)…………………(2)
In this String I want to store all Keywords in Array/collection split from comma.
My problem is that How I can find out the starting and ending point to split the keywords, I can get the Starting point from Keywords: but what should be my ending point to store the keyword in array/collection, there is no any fix format,
there is only one fix format which is there will be a Para after ending the Keyword section.
any one can suggest me regular expression for this.
Seems like you should first split the string into lines.
And then the line that starts with Keywords: holds your keywords.
You can use the
string.Split()method to split into lines as well as for breaking out the keywords.