I want to write a nullable string to file using BinaryWriter
and this code:
BinaryWriter writer = new BinaryWriter(st);
String? s;
if(s!=null){
writer.Write(s);
}
but this error occurs:
The type 'string' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'System.Nullable'
How can I solve this problem?