निम्नलिखित कोड को सफलतापूर्वक संकलित:मैं डीबगर में नई स्ट्रिंग का उपयोग क्यों नहीं कर सकता?
new string(new char[] { 'b', 'a', 'r' });
त्रुटि संदेश है:
'new string(new char[] { 'b', 'a', 'r' })' threw an exception of type 'System.ArgumentException'
base {System.SystemException}: {"Only NewString function evaluation can create a new string."}
Message: "Only NewString function evaluation can create a new string."
ParamName: null
string foo = new string(new char[] { 'b', 'a', 'r' });
निम्नलिखित कोड है, तो घड़ी खिड़की या तत्काल विंडो में चिपकाया का मूल्यांकन किया जा करने में विफल रहता
ऐसा क्यों होता है?
देखें द्वारा
string
कंस्ट्रक्टर्स करने के लिए कॉल करेंगे [इस ब्लॉग पोस्ट में VB.Net के साथ इस अपवाद नहीं देखेंगे ] (http://dotnetdust.blogspot.com/2009/03/string-construtor-stringchar-value.html)। – cdhowieयह अब वीएस 2015 में "निश्चित" है, मैं अनुमान लगा रहा हूं क्योंकि यह रोज़लिन का उपयोग करता है। –