SOUGAT RIYADH
SOUGAT RIYADH

Reputation: 701

How to take a numerical number and store in variable in Flutter

I want to take or extract the numerical digit number and store in variable. For example i have var data=18:00, so i want to take 18 and store in variable and similarly take 00 and store in another variable.

Upvotes: 0

Views: 890

Answers (1)

Pro
Pro

Reputation: 3003

@SOUGAT, you can try split method.

var data = '18:00'
List<String> dataList = data.split(':');
print(dataList[0]); //18
print(dataList[1]);//00

Upvotes: 2

Related Questions