dodai)
{
string subText = text.Substring(0, dodai);
int indexWhiteSpace = subText.LastIndexOf(' ');
m_Result = subText.Remove(indexWhiteSpace) + " ...";
}
return m_Result;
}
public static string GetPathandquery(string input)
{
string m_PathAndQuery = input;
string str_default = "/Style Library/LacViet/CMS2013/Images/newsdefault.jpg";
string str_default2 = "/Style%20Library/LacViet/CMS2013/Images/newsdefault.jpg";
if (m_PathAndQuery == str_default)
m_PathAndQuery = str_default;
if (m_PathAndQuery == str_default2)
m_PathAndQuery = str_default2;
else
{
string[] m_datas = m_PathAndQuery.Split('/');
string Name = string.Empty;
foreach (string m_data in m_datas)
{
if (m_data == "_w" || m_data == "_W")
return m_PathAndQuery;
else
Name = m_data;
}
string m_ThuNghiem = "_w/" + Name.Replace(".", "_") + ".jpg";
m_PathAndQuery = m_PathAndQuery.Replace(Name, m_ThuNghiem);
}
return m_PathAndQuery;
}
public static string StripTagsCharArray(string source)
{
char[] array = new char[source.Length];
int arrayIndex = 0;
bool inside = false;
for (int i = 0; i < source.Length; i++)
{
char let = source[i];
if (let == '<')
{
inside = true;
continue;
}
if (let == '>')
{
inside = false;
continue;
}
if (!inside)
{
array[arrayIndex] = let;
arrayIndex++;
}
}
string m_TextReturn = string.Empty;
if (arrayIndex > 200)
{
m_TextReturn = new string(array, 0, 200);
int indexWhiteSpace = m_TextReturn.LastIndexOf(' ');
m_TextReturn = m_TextReturn.Remove(indexWhiteSpace) + " ...";
}
else
m_TextReturn = new string(array, 0, arrayIndex);
return m_TextReturn;
}
]]>