

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Represent Int32 as a Octal String in C#
To represent Int32 as a Octal string in C#, use the ToString() method and set the base as the ToString() method’s second parameter i.e. 8 for Octal.
Int32 represents a 32-bit signed integer.
Firstly, set an Int32 variable.
int val = 99;
Now, convert it to octal string by including 8 as the second parameter.
Convert.ToString(val, 8)
Example
using System; class Demo { static void Main() { int val = 99; Console.WriteLine("Integer: "+val); Console.Write("Octal String: "+Convert.ToString(val, 8)); } }
Output
Integer: 99 Octal String: 143
- Related Questions & Answers
- Represent Int32 as a String in C#
- Represent Int32 as a Binary String in C#
- Represent Int32 as a Hexadecimal String in C#
- Represent Int64 as a Octal string in C#
- Represent Int64 as a String in C#
- Represent Int64 as a Binary string in C#
- Represent Int64 as a Hexadecimal String in C#
- Char.ConvertToUtf32(String, Int32) Method in C#
- Char.IsControl(String, Int32) Method in C#
- Char.IsLowSurrogate(String, Int32) Method in C#
- Char.IsSurrogate(String, Int32) Method in C#
- Char.IsSurrogatePair(String, Int32) Method in C#
- Char.IsHighSurrogate(String, Int32) Method in C#
- Define integer literals as octal values in Java
- Char.GetUnicodeCategory(String, Int32) Method with Examples in C#
Advertisements