I have a string like this :
SITE IÇINDE OLMASI\nLÜKS INSAA EDILMIS OLMASI\nSITE IÇINDE YÜZME HAVUZU, VB. SOSYAL YASAM ALANLARININ OLMASI.\nPROJESİNE UYGUN YAPILMIŞ OLMASI
I'm trying to split and save this string like this :
array2 = mystring.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
foreach (var str in sarray2)
{
if (str != null && str != "")
{
_is.RelatedLook.InternalPositive += str;
}
}
I also tried
Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
This obviously doesn't split my string. How can I split my string in a correct way? Thanks

\nin the input an actual new line or the text "\n"?s.Split('\n')will work. See ideone.com/Lzj1uU. Also, you may check if a string is null or empty withstring.IsNullOrEmpty(). However, in your case, I'd even usestring.IsNullOrWhiteSpace()str.Split(new[] {"\\n"}, StringSplitOptions.RemoveEmptyEntries).