Hello :)
I have a byte array similar to this (16 bytes):
71 77 65 72 74 79 00 00 00 00 00 00 00 00 00 00
I use this to convert it to a string and trim the ending spaces:
ASCIIEncoding.ASCII.GetString(data).Trim();
I get the string fine, however it still has all the ending spaces.
So I get something like "qwerty.........." (where d...
I'm trying to send a long string by WCF, around 64k chars long. When sending a long string, the I get the HTTP error 400. But when I send shorter string, everything works fine.
Here is the WCF interface and app.config that I use.
My message contract:
[MessageContract]
public class MessageClass
{
[MessageHeader(MustUnderstand = true...
I'm extending Exception to implement a setter on the Message property. And this works just fine. But somehow this:
CustomException.Message = "Test" + Environment.NewLine + "Test Again";
Becomes this:
"Test\r\nTest Again"
I've also tried this, with no luck:
CustomException.Message = @"Test
Test Again";
Any ideas?
...
What is the best/recommended way to add x number of occurances of a character to a string e.g.
String header = "HEADER";
The header variable needs to be have say 100 0's added to the end of it. But this number will change depending on other factors.
...
Why is java.lang.String the only class for which two ways of creation exist:
1) With normal way with "new" keyword.
String s = new String("abc");
2) With String literal (which is only available with String class)
String s = "abc";
So why are there String literals and no literals for any other classes??
...
Is there any existing builtin (or third party) Java class or library that can convert numbers to natural language strings; e.g. 1 -> "one", 2 -> "two", 1256 -> "a one thousand two hundred and fifty-six", etc.?
...
Is there any way with the current delphi to implement.
a) String (as a class) with operator overloads (ie. +, =)
b) Class Helper's so one could add custom string methods
I gather the string is a native type so class helpers will not work without
setting up a class etc.
...
String data
What I am particularly confused about is this statement
"Its contents are guaranteed to remain unchanged only until the next call to a non-constant member function of the string object."
Can someone clarify what does this mean? When to use this and when to avoid using this?
...
Hello everyone. Can anyone please suggest a way to replace back-slash '\' with slash '/' in a string. Basically the string is a path. I have tried using Replace() method of string, but its not working.
Thanks
...
I have a adaptive server anywhere network server(version 7.0),it's name is "TestServer".
Now, Client want to connect this server using OdbcConnetion in DOTNET,How to set the connection string ?
...
C#
It's possible to set to a variant this sentence {"D", and receive precisely the same string. I try some variants, for sample:
1) "{""D""," = "End of expression expeted" error;
2) @"{""D""," = "{\"D\","
Any suggestions?
...
Was asked this question recently and did not know the answer. From a high level can someone explain how Java takes a character / String and convert it into an int.
Many thanks
Karl
Edit: Would also be good to know if other languages do a similar sort of thing as well.
...
When using string.Format(string, object[]) it throws an exception if string contains more format specifiers ({0}, {1:dd-MM-yyyy} etc.) than object[].Length.
I'd like to also throw an exception if object[].Length contains more specifiers. There seems to be no built-in way to do it, so I'm trying to get the number of format specifiers in ...
I'm trying to create a regex that will match only when the string has anything but alphas, spaces, and hyphens. In other words, the string can only contain letters, spaces, and hyphens.
...
I work with a propriety client/server message format that restricts what I can send over the wire. I can't send a serialized object, I have to store the data in the message as a String. The data I am sending are large comma-separated values, and I want to compress the data before I pack it into the message as a String.
I attempted to us...
I am trying to make a function in C that will print a string taken as a parameter. Is this even possible in C?
I have something like this in my header file, but string is not a valid identifier. I understand there are no strings in C, but what's the string.h class for?
#include <string.h>
#ifndef _NEWMAIN_H
#define _NEWMAIN_H
#i...
I'm trying to decode base64-encoded string with openssl. However, it works only 4 times out of 5.
Decoded string should always be 64 chars long. BIO_read() always returns 64. However, sometimes returned buffer is shorter than 64!
Any ideas what is wrong? How can i always get the correct string?
...
Hola!
If i have a string like this:
$myString = "input/name/something";
How can i get the name to be echoed? Every string looks like that except that name and something could be different.
...
Hi, I'm trying to parse a CSV file and automatically create a table for it using SQL commands. The first line in the CSV gives the column headers. But I need to infer the column type for each one.
Is there any function in Ruby that would find the type of the content in each field.
For example, the CSV line:
"12012", "Test", "1233.22",...
For example,
function test (a)
name = nameof(a)
print(name)
end
test(def) --should print "def"
Are there any lua tricks to implement something similar to the above?
...