using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class GlobalClasses : MonoBehaviour { [System.Serializable] public class ClassInfo { public string idCurso, nomeCurso; [SerializeField] public List infos; } [System.Serializable] public class ClassDetailedInfo { public int idclasses, idcourses, disabled, ordem, viewed, sprites, demo; public string name, description; } public static string TratarTexto(string texto) { string returnTxt; returnTxt = texto; returnTxt = returnTxt.Trim(); returnTxt = returnTxt.Replace(" ", " "); returnTxt = returnTxt.Trim(); return returnTxt; } public static string ImgOnSentence(string sent) { int theresImg = sent.IndexOf("src="); int inicioImg = sent.IndexOf("") + 4; string newsent = sent; newsent = newsent.Remove(inicioImg, endImg - inicioImg); int BeginImg = sent.IndexOf("") + 4; try { newsent = RemoverTagsHtml(sent.Remove(BeginImg, EndImg - BeginImg)); } catch (Exception e) { } return newsent; } else { return sent; } } public static string RemoverTagsHtml(string Texto) { Texto = Texto.Replace("

", ""); Texto = Texto.Replace("

", ""); Texto = Texto.Replace("
", "\n"); return Texto; } public static string TakeIpFromHTML(string textImg) { int startindex = textImg.IndexOf("http"); if (startindex != -1) { string newtext = textImg; newtext = newtext.Remove(0, startindex); startindex = newtext.IndexOf("\\\""); newtext = newtext.Remove(startindex); return newtext; } else { return textImg; } } }