Questions tagged [stringbuilder]

Stringbuilder is a class that provides a convenient and efficient way of working with text data in Java and .NET framework.

Stringbuilder is a class that provides a convenient and efficient way of working with text data. Implementation of the stringbuilder can be found in .NET framework and Java.

The very idea of the class is being a character array with the capability to insert and append new characters. It avoids copying the strings in the memory, hence improves the performance.

2114 questions
0
votes
1 answer

How to remove mysterious border in string builder table?

I have some code that generates a PDF. For some reason there is a black bordered cell showing up behind the image on this line: sb.AppendLine("" + "~/images/Products/" + imageName + "~/images/spacer.gif"); I have tried…
Andy Jr.
  • 95
  • 1
  • 10
0
votes
8 answers

whitespace will not get removed

Assume there is a url="www.example.com/". Using the following code I want to remove the trailing slash but it leaves a blank at the end of string (which by the way I do not know why) and using the rest of the code, I am trying to remove the white…
user3049183
  • 136
  • 1
  • 3
  • 16
0
votes
1 answer

How to hide and show another div when I click first div in server side html coding using append

I have two
in server side web service page. If I click the first div, the first div should be hidden and second div should be visible. How to hide the first div and show second div using onclick div in server side web service page.…
0
votes
3 answers

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 52

I started learning Java 2 months ago and get stuck with this problem. Could anyone give me help on this one,please? The Questions: Given a string, for each digit in the original string, replaces the digit with that many occurrences of the character…
kai dai
  • 5
  • 4
0
votes
4 answers

Java - StringBuilder replace() shows error: method String.replace(char,char) is not applicable

I'm trying to compile and test a code I saw online for Expanding an IP add. However when I try to compile it I am getting an error about the StringBuilder replace method. It says : IPadd.java:52: error: no suitable method found for…
Andrew
  • 75
  • 2
  • 7
0
votes
1 answer

C# String/StringBuilder MemoryException on Large set of Replaces

I am trying to figure out a better way to manipulate a large string and using both string and string builder I am unable to. What I have below is a function that takes in a string and we search that string with regex to find any links. Any…
John S
  • 15
  • 2
0
votes
1 answer

Can't return an XML formatted string, using stringbuilder in C# and a DB Template, For a PlaceHolder

Good Afternoon, I have a function that builds a string for a template in my DB that outputs an XML structure. It takes in a Order class as a parameter and a Template, well I am having troubles trying to populate a placeholder tag named [[items]],…
Psy Chotic
  • 219
  • 1
  • 3
  • 11
0
votes
1 answer

deleteCharAt() not deleting character in stringbuilder all of sudden in loop

I need to delete certain chars from a stringbuilder but a couple are not deleted for some reason. This is what I have so far: I have a method with string and arraylist as paramaters. The string I'm passing is the following: "beabeefeab" and the…
0
votes
1 answer

Get UTF8.GetBytes from very large stringbuilder

I have a StringBuilder of length 1,539,121,968. When calling StringBuilder .ToString() on it fails with OutOfMemoryException. I tried creating a char array but was not allowed to create such big array. I need to store it a byte array in UTF8 format.…
serializer
  • 1,003
  • 2
  • 13
  • 27
0
votes
1 answer

Regarding Stringbuilder in c#

is stringbuilder is same in android java and c# ?? im using stringbuilder in c#(REST Webservice).. how can i use with the same functionality in Java? or im using stringentity in java.wat is the equivalent in c#(REST Webservice)? HttpClient client =…
the_dopamine
  • 899
  • 6
  • 12
  • 21
0
votes
1 answer

StringBuilder insert method

I'm attempting to insert a character to the beginning of each substring Instead of inserting at position 0 of the substring, the method is inserting the character(s) to the beginning of the entire string. For example: Input: esttar apple%hc…
user5924094
0
votes
1 answer

StreamWriter 64512 character limitation

I am using stringbuilder to collect some strings in my code. At the of that code my stringbuilder has more than 100000 chars. But writeline function writes only first 64512 chars in stringBuilder. When I debugged the code I saw that stringbuilder is…
neverwinter
  • 810
  • 2
  • 15
  • 42
0
votes
0 answers

Android: read from text file and convert to string, added "dot" in first line

I use below code for read txt file and convert to string After convert, added dot to first line and i cant convert number string to integer Code : StringBuilder buf = new StringBuilder(); BufferedReader in = null; try { …
Mohammad
  • 111
  • 2
  • 13
0
votes
2 answers

StringBuilder count comma and find position

I am trying to map two StringBuilders: string builder1 ="abc1,abc2,abc3,abc4,abc2" string builder2="100,30,15,102,30" both StringBuilders count will be the same and already mapped. But I am searching for a particular number 30 and name like…
gowww
  • 139
  • 1
  • 12
0
votes
2 answers

StringBuilder returning list of strings + a NewLine at the end when copying to clipboard?

I have a loop which is appending a new line every time it loops. By the time it finishes, and I copy to clipboard the StringBuilder.ToString() and I paste it in notepad, the blinking cursor remains on a new line below it, instead of at the end of…
Michael Weston
  • 377
  • 4
  • 15