如何从长文件中获取前几个词(摘录)String。我有一个大故事类型字符串,需要在屏幕上显示前 5-10 个单词,其余的要在下一个屏幕上显示。那么有没有办法做到这一点。我搜索了很多,但无法解决问题。例如:获取我们使用的第一个字母
String sentence = "My single Sentence";
sentence[0] //M
Run Code Online (Sandbox Code Playgroud)
同样,我需要得到一些词。例如:
String bigSentence ='''
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book
''';
//code to get the excerpt()
//predicted output=> Lorem Ipsum is simply dummy text...
Run Code Online (Sandbox Code Playgroud) 我在我的 flutter 应用程序中使用 Firebase Firestore。模式下一切正常debug。但是,在release模式下,我收到以下错误。\n我看到了类似的问题,但它没有解决我的问题。
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: [cloud_firestore/unavailable] \nThe service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.\nE/flutter ( 3646): #0 MethodChannelDocumentReference.get \n(package:cloud_firestore_platform_interface/src/method_channel/method_channel_document_reference.dart:80)\nE/flutter ( 3646): <asynchronous suspension>\nE/flutter ( 3646): #1 DocumentReference.get (package:cloud_firestore/src/document_reference.dart:58)\nE/flutter ( 3646): <asynchronous suspension>\nRun Code Online (Sandbox Code Playgroud)\n$ flutter doctor\n>> Flutter (Channel stable, 2.2.3, Version 10.0.21996.1)\n>> \xe2\x80\xa2 No issues found!\nRun Code Online (Sandbox Code Playgroud)\n我试过
\nINTERNET权限。