如何在C#中的Unicode流中确定单词边界? [英] How do I determine a word boundary in Unicode stream in C#?

查看:177
本文介绍了如何在C#中的Unicode流中确定单词边界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在读取Unicode流,并且宁愿不必将整个字符串都通过正则表达式传递.我可以使用一个简单(可靠)的字符来打断各种语言中的单词吗?

I'm reading a Unicode stream and would rather not have to pass the entire string through a regex. Is there a simple (reliable) character I can use to break words across languages?

我的字节数组可能将基于UTF-16或UTF-8

My byte array is likely going to be based in UTF-16 or UTF-8

推荐答案

如果您使用的是Java,则可以使用

If you are using Java then you can use the BreakIterator.

这篇关于如何在C#中的Unicode流中确定单词边界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆