---
title: "如何替换\\"
author: "cherami"
date: "2007-04-03T06:06:55Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2007-04-03T06:06:55Z"
id: 67781
url: "https://cherami.iteye.com/blog/67781"
---

以前也经常遇到这个问题，但是没有找到解决方案，今天再次遇到这个问题，搜索了下没有什么头绪，很多答案试验了下都是错误的，不得已，自己试吧，最终的结果是：  
replaceAll("\\\\\\\\", "\\\\\\\\\\\\\\\\")  
就是把字符串中的\\替换成两个\\，呵呵，变态吧。