在没有 std 的情况下解析给定的 jstring 的方法是什么?
我在android中,找不到使用字符串函数的方法。不可用吗?
我想要类似的东西:Java 中的 .replaceAll、.split、.startWith 或 StringTokenizer 等。
"jni/hello-jni.cpp:207: error: 'string' in namespace 'std' does not name a type"
谢谢, 莱斯利
最佳答案
我猜想“没有 std”你的意思是没有 C++ 和 std::string
特别是。在这种情况下,您可以使用任何标准 C string functions或者根据需要添加自己的。对于从 jstring
到 const char *
的转换,您可以查看 here .
关于java - JNI 在 android/java 中解析 jstring 或 char* 而不使用 std,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8388224/