- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 Properties in Dart Programming
Strings in Dart have certain properties attached to them. These properties come in handy in different use cases.
The most common used string properties are −
hashCode
isEmpty
isNotEmpty
length
runes
In this article, we will explore all the above mentioned properties of a string.
hashCode
The hashCode property of a string is used to print the hashCode number of the specific string on which it is called.
Example
Consider the example shown below −
void main(){ String name = "Tutorials Point"; print(name.hashCode); }
Output
147510269
isEmpty
The isEmpty property of a string returns true when the string is an empty string.
Example
Consider the example shown below −
void main(){ String name = "Tutorials Point"; print(name.isEmpty); name = ""; print(name.isEmpty); }
Output
false true
isNotEmpty
The isNotEmpty property of a string returns true when the string is not empty.
Example
Consider the example shown below −
void main(){ String name = "Tutorials Point"; print(name.isNotEmpty); name = ""; print(name.isNotEmpty); }
Output
true false
length
The length property of a string is used to print the number of characters that are present inside the string.
Example
Consider the example shown below −
void main(){ String name = "Tutorials Point"; print(name.length); }
Output
15
runes
The runes property is used to print the number of Unicode code-points present in the string.
Example
Consider the example shown below −
void main(){ String name = "Tutorials Point"; print(name.runes); }
Output
(84, 117, 116, 111, 114, 105, 97, 108, 115, 32, 80, 111, 105, 110, 116)
- Related Articles
- String in Dart Programming
- String Interpolation in Dart Programming
- String Methods in Dart Programming
- Comments in Dart Programming
- Constructors in Dart Programming
- Enumerations in Dart Programming
- Functions in Dart Programming
- Immutability in Dart Programming
- Inheritance in Dart Programming
- Iterables in Dart Programming
- Lists in Dart Programming
- Loops in Dart Programming
- Maps in Dart Programming
- Methods in Dart Programming
- Mixins in Dart Programming
