San*_*sal 0 c# string wpf textbox
我目前有以下XAML:
<TextBox Text="" x:Name="textFeedbackFeedback"
Margin="11.593,0,29.307,42.96" TextWrapping="Wrap"
VerticalContentAlignment="Top" VerticalAlignment="Bottom"
Height="92.08" AcceptsReturn="True" VerticalScrollBarVisibility="Visible"/>
Run Code Online (Sandbox Code Playgroud)
我尝试过使用很多变种:
if(textFeedbackFeedback.text == "")
if(textFeedbackFeedback.text == null)
if(textFeedbackFeedback.text == string.Empty)
if(string.IsNullOrEmpty(textFeedbackFeedback.Text))
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,它不会停在那里并继续,好像那里有数据,有人可以帮助我在这里.
谢谢.
尝试 if(string.IsNullOrWhiteSpace(textFeedbackFeedback.Text))
如果这不起作用,请尝试找出文本的长度,以及文本中的chracters的整数/ ascii值.