c# - Separating each 3 integer with dots or commas -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 4 जवाब

कहें कि मेरे पास पूर्णांक है 200000 स्ट्रिंग से पार्स किया जाता है। मुझे प्रिंट करना परिणाम बनाना चाहते हैं, प्रत्येक 3 वर्ण को वापस से गिना जाता है

ex : 200000 => 200,000 या 20000 => 20,000

तो मैं ऐसा कैसे कर सकता हूं?

धन्यवाद अग्रिम में

स्ट्रिंग फ़ॉर्मेटिंग पैटर्न का उपयोग करें:

  int संख्या = 200000; Console.WriteLine (number.ToString ( "###, ###"));  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

ios - Subclassing UIView and adding a property -

Powerbuilder 12.1 and DataWindow in Design vs Debug and Executable/Runtime -