tagged [trim]

How to 'Trim' a multi line string?

How to 'Trim' a multi line string? I am trying to use `Trim()` on a multi line string, however only the first line will `Trim()`. I can't seem to figure out how to remove all white space from the begi...

7 Jan at 23:16

How to Remove the last char of String in C#?

How to Remove the last char of String in C#? I have a numeric string, which may be `"124322"` or `"1231.232"` or `"132123.00"`. I want to remove the last char of my string (whatever it is). So I want ...

27 Jul at 11:55

How to trim whitespace from a Bash variable?

How to trim whitespace from a Bash variable? I have a shell script with this code: ``` var=`hg st -R "$path"` if [ -n "$var" ]; then echo $var fi ``` But the conditional code always executes, becaus...

20 Jun at 05:55

Why string.TrimEnd not removing only last character in string

Why string.TrimEnd not removing only last character in string I have string as below So now i want to remove only last comma in above string. So i want output as I decided to use TrimeEnd as below But...

6 Jul at 11:12

Remove '\' char from string c#

Remove '\' char from string c# I have the following code ``` string line = ""; while ((line = stringReader.ReadLine()) != null) { // split the lines for (int c = 0; c

5 Dec at 09:47

How to remove spaces and newlines in a string

How to remove spaces and newlines in a string sorry if they are not very practical for C # Asp.Net, I hope to make me understand I have this situation I would make sure that the string does not contai...

9 Jan at 10:19

How to remove whitespace from a string in typescript?

How to remove whitespace from a string in typescript? In my angular 5 project, with typescript I am using the .trim() function on a string like this, But it is not removing the whitespace and also not...

7 Mar at 11:6

How to extend C# built-in types, like String?

How to extend C# built-in types, like String? I need to `Trim` a `String`. But I want to remove all the repeated blank spaces within the String itself, not only at the end or at the start of it. I cou...

18 Dec at 22:59

Iterate through Object's own Strings & Trim each

Iterate through Object's own Strings & Trim each I have multiple large objects which each have about 60 strings. I have to trim all those strings, and I'd like to do so without having to go this.mystr...

11 Jul at 07:46

String from byte array doesn't get trimmed in C#?

String from byte array doesn't get trimmed in C#? I have a byte array similar to this (16 bytes): I use this to convert it to a string and trim the ending spaces: I get the string fine, however it sti...

9 Sep at 23:11

trim all strings in an array

trim all strings in an array I have a string that comes in like: I want to split it into an array of strings If I do this: I get spaces in front of each email address (after the first one): What is th...

7 Aug at 06:43

C# trim within the get; set;

C# trim within the get; set; I am total MVC newbie coming from 10 years of webforms. Here is the code I have inherited: How can I apply a trim function to the "set" portion of this code? Right now it ...

28 Dec at 20:34

Trim Whitespaces (New Line and Tab space) in a String in Oracle

Trim Whitespaces (New Line and Tab space) in a String in Oracle I need to trim New Line (Chr(13) and Chr(10) and Tab space from the beginning and end of a String) in an Oracle query. I learnt that the...

15 Feb at 21:32

How to Select a substring in Oracle SQL up to a specific character?

How to Select a substring in Oracle SQL up to a specific character? Say I have a table column that has results like: I would like to be able to write a query that selects this column from said table, ...

29 May at 16:10

Perform Trim() while using Split()

Perform Trim() while using Split() today I was wondering if there is a better solution perform the following code sample. Is there a way to perform trim

23 May at 12:10

Trim whitespace from a String

Trim whitespace from a String I know there are several ways to do this in Java and C that are nice, but in C++ I can't seem to find a way to easily implement a string trimming function. This is what I...

23 Oct at 20:40