1,060 questions
0
votes
2
answers
68
views
How to auto-adjust the width of an input field based on character length of the decimal displayed within?
I'm working on a very simple program that takes a user-specified number (can be an integer or a float of any length) and performs one specific multiplication operation on that number. The program then ...
2
votes
2
answers
70
views
What Excel function can I use to calculate the length of a date time string?
I am trying to calculate the length of the date-time string in a cell
In Microsoft Excel I am using the LEN function to calculate the length of the date time string in cell C2.
The value in C2 is 2017-...
-1
votes
1
answer
85
views
How to count string's length in Python (if the string includes character escaping)? [closed]
There is a string
x = '1a\u0398\t\u03B43s'
How to count its length only using code?
I mean to add before the string r manually is no good
(x = r'1a\u0398\t\u03B43s').
Have tried this solution, but ...
0
votes
1
answer
837
views
In Entity Framework how should I limit string length to no greater than 12000 characters
I tried the obvious...
[StringLength(12000)]
public string Instructions { get; set; }
...(also tried MaxLength) but when I run add-migration I get empty Up() and Down() methods. The only impact of ...
0
votes
1
answer
48
views
how to select rows that are x characters shorter than longest
I have a study assignment and I've been banging my head in the wall for at least a day now.
I'm totally new to this and just learning the basics.
This is my assignment:
Use union to combine these ...
0
votes
2
answers
306
views
In Tcl, why is the string length of an empty string 1, not 0?
In tclsh, first make an empty string:
set a []
Then run the following command:
string length a
It returns 1.
I'm expecting a return value of 0 for the length of an empty string, because it is defined ...
-1
votes
1
answer
207
views
C++ wrong std::string length when using constructor from "empty" char array
I tested this code snippet on different compilers but always got the same result, but I just can't understand why.
unsigned char buffer[0x4000] = {0};
string strText((char*)buffer, 0x4000);
cout <...
0
votes
1
answer
48
views
How to get terminating length in length of string in java? [closed]
As the strings in C/C++ are terminated with the null character '\0', the strings in Java are terminated with length in length.
How to get this length of string without using any in-built function in ...
1
vote
2
answers
255
views
Some test cases failing while trying to implement palindrome of a string in C without using built in functions
I was given this problem as a lab assignment and I've only got 3 days left to submit it.
The program is to print 1 for a palindrome and -1 for not palindrome. I could've easily done this using strrev()...
-1
votes
2
answers
65
views
The "randomword" can not access the .length method. Why is that?
I am trying to make a hangman game and I have a problem with finding the length of the random word chosen automatically
import java.util.Scanner;
import java.util.Random;
public class Main {
...
-2
votes
1
answer
57
views
While condition in python doest stop the loop when true
I made a loop that needs to stop once the list U has no values in it. Once it reaches that point, the loop doesnt stop and it gives an error, because there is a value by 0 (the len(U) in the last loop)...
1
vote
2
answers
113
views
Oracle - Why I can't exclude rows where length(listagg(somecolumn)) > xxx
I just can't seem to work this one out :(
I run a query that returns some results but in those results I need to filter out where this customer does not have freetext notes that are greater than 240 ...
2
votes
1
answer
222
views
In a batch script, is there a documented length limit for Labels and the text which appears _after_ the Label?
Consider the following Label with text added after to clarify what the arguments are for in a batch script (anything after a space is ignored . . .):
:LineBuilder [1 - main var type 1] [2 - main var ...
1
vote
4
answers
851
views
Get the printed length of a string in terminal
It seems like a fairly simple task, yet I can't find a fast and reliable solution to it.
I have strings in bash, and I want to know the number of characters that will be printed on the terminal. The ...
-3
votes
5
answers
264
views
Python Beginner lerning len [closed]
I am doing some exercises, and I am a beginner in python. Doing some coding challenge and there was an exercise that tells me I should ask my name, and it should show me how many letters my name has.
...
0
votes
1
answer
2k
views
How many characters are in RSA SSH public key?
In the Linux terminal, I am generating an RSA key as follows:
ssh-keygen -t rsa -b 1024
I expect to get a public key consisting of 1024 bits.
when I show the public key using this command:
cat id_rsa....
0
votes
1
answer
88
views
How to make a column hold the length of an other column in mysql?
I have a simple table:
CREATE TABLE Tabale.new_table (
index INT UNSIGNED NOT NULL AUTO_INCREMENT,
col1 VARCHAR(45) NULL,
length_of_col1 INT NULL,
PRIMARY KEY (index),
UNIQUE INDEX ...
1
vote
0
answers
56
views
PHP Limit words breaks div in string
I use the following php function to limit word length:
function limit_words($phrase, $max_words) {
$phrase_array = explode(' ',$phrase);
if(count($phrase_array) > $max_words && $...
0
votes
1
answer
69
views
How to specify spacings among words of several sentences to force nth word in each sentence start from exact the same coordinate on plot in python
I am trying to write some grouped texts, each sentence in each group contain 4 parts: value + unit + symbol + value e.g., 0.1 (psi) -> 0.0223, on a plot. Each group will begin from a specified ...
-1
votes
3
answers
83
views
Is there a way to count the length and occurrences of repeated elements in a string?
I have this long string:
string = 'FFFFFFFFFFFFFFFFFFFFFABCABCABCBACBCABCBCABCABCBACBFFFFFACBCABCAFFF'
I want to count the occurrences of repeated 'F' sequences and their length. In this example, ...
0
votes
2
answers
139
views
Why is the length function not working in this for loop?
Why this code is not working after using length function ?
If I use for(n of names) this for loop then its working fine!
I am trying to capitalize each first letter of the names array. So, firstly I ...
-3
votes
3
answers
498
views
Why the strlen() function doesn't return the correct length for a hex string?
I have a hex string for example \xF5\x17\x30\x91\x00\xA1\xC9\x00\xDF\xFF, when trying to use strlen() function to get the length of that hex string it returns 4!
const char string_[] = { "\xF5\...
-1
votes
1
answer
45
views
Get Xpath results on 13 digits length (website crawling)
i am searching a way to get the 13 digit (EAN) code of the following code:
`<dl>
<dt>Merk:</dt>
<dd>Keddoc</dd>
<dt&...
2
votes
2
answers
415
views
How to print the longest sentence from a column in a csv file
I am very new to python and am really struggling with this problem. I have a csv file with different columns, labeled "height" "weight" "full_name" etc. I'm trying to ...
0
votes
1
answer
114
views
How to find the biggest word in a 2D array?
I have an array that has a list of 15 different country names. I have to create a function that finds the largest name and returns its index, and if there are more then one that have a maximum length ...