---
title: "字符之间添加空格"
author: "zjsrustar"
date: "2011-08-24T17:21:04Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2011-08-24T17:24:07Z"
id: 1157159
url: "https://zjsrustar.iteye.com/blog/1157159"
---

```
public class Test {
	public static void main(String[] args) {
		 System.out.println("123456789012345".replaceAll("\\d{1}(?!$)", "$0 "));
	}
}
```

 

输出：

1 2 3 4 5 6 7 8 9 0 1 2 3 4 5