开发者

How to flush the value of StringBuilder variable in android?

开发者 https://www.devze.com 2023-04-12 21:54 出处:网络
I am working on an android app in which i have a static StringBuilder variable named DT开发者_StackOverflow社区_selected.I want to flush this variable\'s value on a checkbox check.Anyone have any idea

I am working on an android app in which i have a static StringBuilder variable named DT开发者_StackOverflow社区_selected.I want to flush this variable's value on a checkbox check.Anyone have any idea or experience how to do it?


I'm not exactly sure what you are looking to do but you can't "flush" a string builder, its not a stream. You can get its contents with toString() or you can create a new empty string builder:

 builder = new StringBuilder();


i have used...

someStringBuilder.Remove(0,someStringBuilder.Length);

or
string theString = someStringBuilder.ToString();
someStringBuilder.Replace(theString,"");

 it will help u...
0

精彩评论

暂无评论...
验证码 换一张
取 消