- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
String Template Class in C#
StringTemplate class is used to parse the format string, so that it is compatible with String.Format. The StringTemplate class comes under the NString library that has extension methods. These methods makes string manipulations easy to use like.
IsNullOrEmpty() IsNullOrWhiteSpace() Join() Truncate() Left() Right() Capitalize()
StringTemplate.Format is better than String.Format since it is more readable and less prone to errors.
The order of the values can be easily formatted. The values are formatted in a way similar to String.Format, but with named placeholders instead of numbered placeholders.
The following is a sample −
string str = StringTemplate.Format("{ExamName} will held on {ExamDate:D}", new { p.ExamName, p.ExamDate });
- Related Articles
- String Template Class in Python?
- String class in C#
- Template Metaprogramming in C++
- Template Specialization in C++
- is_final template in C++
- is_fundamental Template in C++
- is_pod template in C++
- is_pointer Template in C++
- is_signed template in C++
- is_unsigned template in C++
- is_void template in C++
- is_standard_layout template in C++
- is_class template in C++
- is_const Template in C++
- is_lvalue_reference Template in C++

Advertisements