拆分十六进制字符串没有空格和翻转 [英] Split a Hex String without spaces and flip it

查看:726
本文介绍了拆分十六进制字符串没有空格和翻转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要拆分的字符串是这样的:

I need to split a string like this:

String= 0C46BA09

我知道展位StringTokenizer类和String.split()方法,而我用用空格分割字符串。

I know booth the StringTokenizer and the String.split() methods, and I have used them to split strings with spaces.

但在这种情况下,我没有空间设置为条件,所以...我怎么能拆分此字符串逐一得到每个字符?

But in this case I haven't got spaces to set as condition, so... How could I split this string to get each char one by one?

EDITED

这样做的真正purpouse是扭转这种十六进制字符串,所以作为这个 0C46BA09 来得到这个 09BA460C

The real purpouse of this is to reverse this HEX String, so being this 0C46BA09 to get this 09BA460C.

所以,我想知道如果有一个简单的方法来做到这一点,或拆分是什么()方法来获得它的唯一途径。

So, what I want to know if there is an easy way to do it, or the split() method is the only way to get it.

EDITED 2

这个最后一个问题的新链接:

New link with this last question:

翻转一个十六进制字符串

推荐答案

您可以做

char[] charArray = "0C46BA09".toCharArray();

这篇关于拆分十六进制字符串没有空格和翻转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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