title: c# byte to string from udp server
body: <p>I have a simple UDP server that works - I want to enter the data I'm getting to MySql.</p>
  
  <p>When I setup the UDP server "enter" that data as a byte - then how do I convert it to string , and then cut it using delimiter ?</p>
  
  <p>when i look at the CMD window - everything is working as it should, so the server is OK 
  my problem is converting it to string so I can "cut" when I want - after "!</p>
  
  <p>the message is Ok and I get it as I should ,</p>
  
  <pre><code>        char delimiter = '!';
          String CutData;
  
          byte[] data = new byte[1024];
  
          while (true)
          {
              data = newsock.Receive(ref sender);
  
              CutData = data.ToString();
              String[] ToDb = CutData.Split(delimiter);
  
  
              Console.WriteLine(Encoding.ASCII.GetString(data, 0, data.Length));
  
          }
  </code></pre>
  
  <p>Thanks,</p>