Question by
Gun_Asylem · Nov 20, 2019 at 11:39 PM ·
resources.loadstring.split
imported text contains extra character
I have a txt file in my resources folder that contains a list of words..(each on its own line) my code Reads the file, and puts the different lines into a list for checking.
private void Awake() {
TextAsset MytextAsset = Resources.Load("Words", typeof(TextAsset)) as TextAsset;
dictList = MytextAsset.text.Split('\n').ToList<string>();
}
the problem is. the items contains an extra character at the end of each list item. (cannot see it) if i put my cursor on the right of the the item, i have to press left twice to get to the next character.. so i cannot use list.contains to find the matching word because the extra character is there? any ideas?
Comment