如何检查字符串是否已在C#中读取?

问题描述:

我只想检查是否已在C#中读取字符串。这是我的项目



谢谢你的回答

I just want to check if a string has already been read in C#. this is for my project

thank you for your answer

你没有。没有检查是否已读取字符串这样的事情。



也许您需要提供有关问题和所涉及代码的更多详细信息。
You don't. There is no such thing as "checking to see if a string has been read".

Perhaps you need to provide a LOT more detail on the problem and the code involved.


检查一下:如何:比较字符串(C#编程)指南) [ ^ ]


我想你可以检查是否已经为字符串分配了值,但是检查字符串是否已被读取是不是逻辑,VB.Net中的代码可以转换为C#如果你没问题



代码应该看起来

I think you can check if value has been assigned to the string but it is not logic to check if a string has already been read, code in VB.Net and you may convert to C# if it is OK with you

code should looks
Private IsValueAssigned As Boolean
Public ReadOnly Property IsHaveValue As Boolean
    Get
        Return IsValueAssigned
    End Get
End Property

Private stringValue As String
Public Property ValueString As String
    Get
        Return stringValue
    End Get
    Set(value As String)
        stringValue = value
        IsValueAssigned = True
    End Set
End Property