FAQ Database Discussion Community


R is passing list index value as numeric, how to force pass as characters

r,casting,character,r-factor
I have some code which passes a list containing some strings to another function. Thing is the new function doesn't use the string associated with the index, but rather uses the index number. How do I force it to use the string value behind the index value? My code for...

c# I want to know if the first 3 characters in a string is letter?

c#,string,numbers,character
I'm developing a license plate number recognition system. The plate numbers in our county has a string length of 6-7. The first 2 or 3 character are letters and the rest are numbers. I want to check when my system detect a object and recognize it then if the output...

Create character map image for a font

image,fonts,character,photoshop,adobe-illustrator
This seemed like the most sensible place to ask this but I'm not sure. What I'd like is an image, a .jpg or a .png or even a .psd, which has the character map of some font I like, and that is 2048x2048.

Unix Pattern Matching

unix,character,match
So I need to do this pattern match and I need to list all files in a folder that have the characters "file" and one more character afterwards. so I need to type ls -1 "file" but im missing what it takes to find all files that have one more...

Oracle Import Error - Field Length

oracle,import,oracle11g,set,character
I'm running into errors when trying to import a table from a western character set into UTF character set. I know the problem is that some of the data "grows". F For example: ORA-02374: conversion error loading table "RESULT" ORA-12899: value too large for column MATRIX_NAME (actual: 11, maximum: 10)...

Characters arbitrarily being changed

html,text,character,rendering
I've came across this issue where the browser (Chrome) is sometimes rendering characters as completely different ones, however in inspect element they're written how they should be. You'll see in the images that on the right inspect element shows what it's supposed to be, and on the left shows what...

Delete “very” special characters from string

php,character,deleting
How to delete "very" special characters from string? Characters like heart, star, bull, copyright etc. I found this: $re = "/\\p{S}/i"; $str = "asdas�sadsad"; $subst = ""; $result = preg_replace($re, $subst, $str); but it's delete too much (eg. "+" char)....

Javascript Display Characters Remaining Update With Button Hold

javascript,character
I am displaying the amount of characters remaining in this text_area: <%= f.text_area :review_text, id: 'review_text', :size => "50x20" %> Using: <span id="counter" data-maximum-length="<%= @maximum_length %>"><%= @maximum_length %></span> characters left and the javascript: $(document).ready(function() { var review_text = $("#review_text"); var counter = $("#counter"); var max_length = counter.data("maximum-length"); review_text.keyup(function() { counter.text(max_length...

How can I read a text file and store/print it to the console with only lowercase letters and no spaces?

java,file,io,character
I am trying to take in a text file (UTF-8) and store/print it with the following constraints (see example below): Only letters, no special characters (a-z) If the letter is uppercase, convert to lower case No spaces or lines between letters I first tried using scanner to read until the...

How to make an array of characters into an array of strings in Swift

arrays,xcode,swift,character
Here is my code: var myString:String = "abc" var myStringArray = Array(myString) myStringArray[0] = String("cow") I turn the string "abc" into the array ["a","b","c"]. I then try to turn the first element into "cow" so that I have the array ["cow","b","c"]. But it doesn't let me do the last part...

Insert character inside a string of random letters but maintain possibility to become word, is it possible without immense data-structure?

java,string,search,insert,character
I have a dictionary (approx 200k words) which is in alphabetical order. I only need to know if a string of letters can still become a word after a character has been inserted anywhere in the string. In other words: I need to know which characters inserted at a specific...

In Java, is it safe to call Character.isXxx() methods with an int returned from InputStream.read()?

java,unicode,character,inputstream
When reading a text file, I would like to do something like this: InputStream input = ...; int read = input.read(); if (Character.isWhitespace(read)) { // do something with the whitespace } The alternative would be to check for a negative read() return value (aka, end of input) and explicitly cast:...

Setting Numeric Values to Card Values

java,arraylist,javafx,integer,character
here is what I have now: import javafx.application.Application; import javafx.event.ActionEvent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.image.Image; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.stage.Stage; import javafx.scene.image.ImageView; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import...

C program to count words in a given string/sentence?

c,arrays,count,character,words
I want to count the words in a given string by counting the spaces between them. Here's the code that i've tried. #include<stdio.h> #include<conio.h> #include<string.h> main() { int t,i,b=1; char a[100]; printf("Enter a sentence: "); gets(a); t=strlen(a); for(i=0;a[i]!='\0';i++) { if(a[i]=' ') { b++; } } printf("The number of words in...

Haskell recursion with list of characters

string,list,haskell,recursion,character
I am studying Haskell and something came up where I am stuck on for few days.. so I am basically trying to recurse through the list of character (String) and once it reaches the end of the string, is there a way for me to recurse through the list from...

Character is not accepted [duplicate]

c,character
This question already has an answer here: C skipping one command of a function? 2 answers I've written a C program to count the number of occurrences of an entered character. When I execute,I could only enter the file name.Before I enter the character to be counted , the...

How can I change keyboard output to diagonal arrows in Linux? (↖↗↘↙) (SOLVED)

linux,keyboard,character,diagonal,xmodmap
(I am running Linux Mint 17) Hello all, using xmodmap, I would like to make my keyboard type the characters ↖ ↗ ↘ ↙ I know how to do up, left, down, and right arrows (↑ ← ↓ →) already, such as this up arrow example: xmodmap -e "keycode 25...

How to increment a letter in string in lc3?

string,assembly,encryption,character,lc3
I am writing an LC3 program that increments each letter of a three-letter word stored in memory following the program. 'a' becomes 'd', 'n' becomes 'q', 'z' becomes 'c', etc. I am using this as LC3 Assembly a reference Here is my code so far .orig x3000 ADD R1, R1,...

R Creating a Character Column from a Numeric Column w/o using For Loop

r,for-loop,mapping,character,lookup
I am trying to create a column of characters based on an existing column of numbers, preferably without using a for loop. I have come up with a variety of ways to do this, but I keep feeling like I'm making this far more complicated than it needs to be....

Making one character out of array in R

arrays,r,character
I have a vector of numbers values<-c(7,0,1.708) that I would like to re-write as a character of length one 7:0:1.708. I have tried value<-("values[1]:values[2]:values[3]") but that doesn't do the job and I feel like I'm missing something pretty simple. Any help?

How can I check if a character is allowed to be uploaded in Teradata?

character,teradata
How can I check if a character is allowed to be uploaded in Teradata ? Recently I was uploading (using jdbc) a .csv file that contained some weird SUB characters. The upload failed. Later i found out that those weird characters were the older version of the end of file...

Convert Character to Int in Swift 2.0

swift,int,character,swift-playground,swift2
I just want to convert a character into an Int. This should be simple. But I haven't found the previous answers helpful. There is always some error. Perhaps it is because I'm trying it in Swift 2.0. for i in (unsolved.characters) { fileLines += String(i).toInt() print(i) } ...

Presence of a particular character in a string

python,string,character
How to check if a string has at least one of certain character? If the string cool = "Sam!", how do i check to see if that string has at least one !...

extract numerical suffixes from strings in R

r,string,character
I have this character vector: variables <- c("ret.SMB.l1", "ret.mkt.l1", "ret.mkt.l4", "vix.l4", "ret.mkt.l5" "vix.l6", "slope.l11", "slope.l12", "us2yy.l2") Desired output: > suffixes(variables) [1] 1 1 4 4 5 6 11 12 2 In other words, I need a function that will return a numeric vector showing the suffixes (each of which be...

Can we get factor matrices in R?

r,matrix,vector,integer,character
It seems not possible to get matrices of factor in R. Is it true? If yes, why? If not, how should I do? f <- factor(sample(letters[1:5], 20, rep=TRUE), letters[1:5]) m <- matrix(f,4,5) is.factor(m) # fail. m <- factor(m,letters[1:5]) is.factor(m) # oh, yes? is.matrix(m) # nope. fail. dim(f) <- c(4,5) #...

How to convert characters to date in SAS proc sql

date,sas,character
I have a column of data named yearmonth stored as characters data. I want to convert this column into SAS date in another column with format dd/mm/yyyy. for example lets say one of the data is 201201. I want to convert it into 15/01/2012. The problem is I can only...

Prevent repetition of output characters in c

c,string,character,output,repeat
Here I have a code that is to output the vowels used in a string and ignore the consonants. However it repeats the output of the vowel if that vowel is used more than once in the input string. Is there some way that I can prevent repetition of characters...

Uppercase accented characters displayed as “?”

java,utf-8,character,decoding,latin1
I got a string value from a db table with latin1 as collation. Though, he text contains UTF-8 characters. So I did this in my web server logic (Java) to resolve weird characters : new String(latin1.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8); Everything is fine now but uppercase accented characters (ex: À) are still displayed...

R how to get a list of characters in a string

r,string,character
In R how could i get list of characters that are contained in a string. I have provided an example below somefunction("abc") should return "a","b","c" =============================update1 I am planning to get all the characters, sort them and join them back. I tried paste function but it didnt work :( Any...

Convert java char inside string to lowerCase/upperCase

java,string,character,uppercase,lowercase
I have a String called "originalstring" which contains a sentence with mixed upper and lower case characters. I simply want to flip the string so that if a character is a lowercase make it upper case and vice versa and return it. I have tried this code, which returns the...

How to add characters to filename using glob in Python?

python,character,glob,qgis
The following is a snippet of code. The script takes the input files from a "Test" folder, runs a function and then outputs the files with the same name in the "Results" folder (i.e. "Example_Layer.shp"). How could I set it so that the output file would instead read "Example_Layer(A).shp"? #Set...

Q: Android not accepting special characters on Toast/Dialog.

android,dialog,character,toast
Im inputing some special characters on my toast and dialog messages, and end up switching for a "?". Ive tried to follow some questions here on stack but none end up working. Check one example: Toast.makeText(Emprestimo.this, "Insira o valor do empréstimo.", Toast.LENGTH_LONG).show(); The word above "empréstimo" on the Toast message...

Character pointer access

c++,character
I wanted to access character pointer ith element. Below is the sample code string a_value = "abcd"; char *char_p=const_cast<char *>(a_value.c_str()); if(char_p[2] == 'b') //Is this safe to use across all platform? { //do soemthing } Thanks in advance...

How do you find the index of a character in a string?

python,function,indexing,character
I'm trying to create a program that finds the index of a character in a string,(without using any functions other than range,if statements, while loops,or for loops) but I can't figure out how to do it. Help would be greatly appreciated. def findIndex(char, test): while char!=testList: for i in range(len(test)):...

character printing confusion

c++,character,sequences
I have some code: #include <iostream> #include <string> using namespace std; int main(){ char abc [20] = "Hello Hello Hi"; char* ptr = abc; cout << (abc+3); return 0; } Why does it print out from the third character up and not simply the third character? -edit- to whoever flagged...

Find out if Character in String is emoji?

ios,string,swift,character,emoji
I need to find out whether a character in a string is an emoji. For example, I have this character: let string = "😀" let character = Array(string)[0] I need to find out if that character is an emoji....

Separate long text into pages for viewpager

java,android,string,text,character
I'm implementing messureText method in this question to separate long text into pages with specified size before rendering in viewpager. I'm doing a while loop with incremental number of characters to get desired text blocks but it seems not to be the best solution. Is there any suggestion to improve...

Characters and Strings in Swift

ios,string,swift,unicode,character
Reading the documentation and this answer, I see that I can initialize a Unicode character in either of the following ways: let narrowNonBreakingSpace: Character = "\u{202f}" let narrowNonBreakingSpace = "\u{202f}" As I understand, the second one would actually be a String. And unlike Java, both of them use double quotes...

How to get all the characters within the range specified by the matrix in MATLAB

matlab,matrix,character
Is it possible to get all the characters within the range specified by the matrix For Example: My matrix is something like this: A = ['a' 'b' 'c'; %// Start index 'd' 'e' 'f']; %// End Index Expected output vector (cell-Array of string) Out = {'abcd' 'bcde' 'cdef'} Any help...

C printf %c character printing [duplicate]

c,memory,character
This question already has an answer here: Single quotes vs. double quotes in C 11 answers The following code prints (compiled with clang) Output [A][?][?] Code #include <stdio.h> int main(){ char a = "A"; printf("[A]"); printf("[%c]", a); printf("[%c]", "A"); } Gives a warning (clang does) test.c:4:10: warning: incompatible pointer...

OrientDB import CSV is modifying my property name

csv,properties,import,character,orient-db
I'm no expert in OrientDB, and I'm having a problem with an odd character showing up in the command line. Oddly enough, it's in the name of my property. Because the name of the property is different, my queries are breaking. For example, I can't execute SELECT * FROM Class...

How to obtain numeric and non-numeric values from a String

java,string,character
Let's say there are three strings: String s1 = "6A"; String s2 = "14T"; String s3 = "S32"; I need to extract numeric values (i.e. 6,14 and 32) and characters (A,T and S). If the first character was always a digit, then this code would work: int num = Integer.parseInt(s1.substring(0,1));...

Convert character longitude/lattitude into numeric

r,character,numeric
I have a dataset in R called Test with longitude latitude coordinates that now have the following format after having called str(Test): $ lat : chr "513.035.763.793.677" $ lon : chr "33.941.883.804.984" i would like to turn these into correct lon - lat coordinates. The following doens't work: as.numeric(Test$lat) as.numeric(gsub(".",...

Checking for repeated characters in password using Java

java,validation,passwords,character
I'm a student of CIS taking a Java class (hoping to become a programmer). Anyhow, I have an assignment to create a program that checks a password for validity. If the password is not valid, it is to print a message. If the password is valid, the user is to...

Raw character literal

c++,c++11,character,string-literals
I don't know if I've missed something or it really doesn't exists. In the C++11 standard the Raw string literals were added: string s = "\\w\\\\\\w"; // I hope I got that right string s = R"(\w\\\w)"; // I'm pretty sure I got that right But all my attempts to...

Oracle Import option

oracle,import,oracle11g,character,utf
I have a simple question, how exactly do you use the oracle import tool to import a database with the option of automatically resize the column length, so it automatically fits the data before importing the data. Give you an example: if I have a table TABLE1 that has a...

Given a string of parentheses, write a program to find whether its valid or not

c,arrays,string,character
Given a string of parentheses, write a program to find whether its valid or not. Examples- input : {{{}}} output: Valid input : }{}{}{}} output: Invalid I wrote the following code in C and tested that the output were coming correct. #include <stdio.h> #include <stdlib.h> int main() { char str[20];...

Dealing with plus and minus signs in regexpr in R

regex,r,string,character,numeric
I would like to include the the minus or plus sign when extracting numeric data from a character string. The number is 8.81e+001. Using the following code I can get the e, but not the + and subsequent numbers. wg_co2 <- all_data[wg_co2 <- grep("Carbon Dioxide",all_data)] [3] wg_co2 <-regmatches(wg_co2, regexpr("[0-9]{1,9}.[e-e0-9]{1,9}",wg_co2)) wg_co2...

Why a dangerous method doesn't work with a character element of String in Ruby?

ruby,string,character,upcase
When I apply the upcase! method I get: a="hello" a.upcase! a # Shows "HELLO" But in this other case: b="hello" b[0].upcase! b[0] # Shows h b # Shows hello I don't understand why the upcase! applied to b[0] doesn't have any efect....

How to make an invisible character in HTML, that still get's picked up on text selection?

html,css,character,spreadsheet
Backstory So I am doing a webchat as a side-project, and one of the issues I am encountering is making the UX of copying and pasting messages friendly. Right now all of the elements are organized within their own tags, spaced out and separated with CSS rules, in a way...

Assigning Values to a character type string

c++,arrays,string,character
char *pro[x]={"A","B","C","D"}; I can't initialize 'pro' with these alphabets i have also tried it like this: char *pro[x]={'A','B','C','D'}; How can i store these alphabets in this array?...

R - extract row as character string with double quote

r,data.frame,character
I have a data frame called dataf dataf<-data.frame(replicate(10,sample(0:1,10,rep=TRUE))) and I would like to extract each row of this data frame as a character string like with this function : result=data.frame(matrix(NA, ncol=1, nrow=10)) i=0 for(i in 0:9) { result[i+1,]=toString(dataf[i+1,]) } but result is not as expected : 1, 0, 0, 0,...

(VBA Excel) Extract Text and related Letter from String and output result

regex,string,excel-vba,character,number-formatting
So the scenario I have is there are letter with a number: Desired Output after Program (Note an underscore is visually used but I need a space: ____________F __G _____E __G__E______F Currently I have written code in the Number and First Letter Column to extract the number and first letter:...

Replace one accentued characters in php

php,character,accented-strings
I have a string with one french accentued character (ex : lycée). I want just replace one character but accentued character is like 2 characters and result is never good : $str='lycée'; $str[3]='o'; echo $str; Result would be : lycoe But result is lyco�e (All settings is set to UTF8...

MySQL show all lines except those with special character

mysql,character,lines,ignore
I have a table with following fields as example. I'm wondering how to ignore some lines WHERE the info has special character or is empty. Table1 with fields Username NumberID CodeUser: Username NumID CodeUser user1 12345 2454 user2 1452T /500 user3 45172 user4 3145Z /076 For this example I would...

java regex: capitalize words with certain number of characters

java,regex,string,character
I am trying to capitalize the words in a string with more than 5 characters. I was able to retrieve the number of words that are greater 5 characters using .length, and I could exclude the words that were greater than 5 characters but I couldn't capitalize them. Ex. input:...

Upper case conversion and digit summing

c,character
My programs goal: Only the letters will be printed out nothing else. The program will continue until the return is received at which time the sum of the digits will be printed on the next line. Use getch not getchar... It's suppose to only print the uppercase letter. I'm just...

Removing Column from Dataframe that contains a string in R

r,string,parsing,character,frames
I'm trying to create a shiny app that allows people to input data. To make the data usable I'm trying to remove any column that has an instance of a string in a dataframe df. This task was really simple in python but in R has become quite tough. My...

Notepad++ how to swap characters in a string

character,notepad++,swap
I have a computer generated text file. I need to swap positions of certain entries. These entries are always 4 characters long and separated from the rest by semicolons. The 4th character needs to become the first character. For example: ;1234; has to become: ;4123; Note: There's a lot of...

Regex: with repeated characters

regex,character
i'm trying to catch every two repeated characters in a word. I tried this: (\w)\1+ but for some reason it only catches the first two pairs. For instance: the word "hellokitty", it catches the "ll" and ignores the other "tt" as tested in regex101 ...

Replace illegal character in javascript string with the legal one

javascript,replace,character
how do I replace illegal character in a javascript code? I found a lot of solution to strip them off the string but none to actually keep the char there. here an example line: document.getElementById("popupcontent").innerHTML += "<img class='popupbanner' src='" + eventcontent[date][i]['bannerimg'] + "' />"; So in my function, it make...

R: Combine character columns of data.frame into one vector

r,string,data.frame,character
I am working with R and trying to combine two character columns of the data frame into one vector. Let us say, here is my data a = c("one", "two", "three") b = c("four", "five", "six") data = data.frame(a,b) Now I try c(data$a, data$b) or c(data[,"a"], data[,"b"]) Both give me...

Swift: String contains Character?

string,swift,character
How do I check if a String includes a specific Character? For example: if !emailString.hasCharacter("@") { println("Email must contain at sign.") } ...

Matching and Counting Strings of Characters in R

r,string,character
I have an array of strings of characters made up of all the possible combinations of the 4 letters J, K, Q, Z. The entries in the array are made up of at least two letters and at most 4. For example: data<-c("QK", "KQ", "JKQZ", "KJZ"). I would like to...

Swapping character locations in a string (bash)

string,bash,location,character,iccid
I have encountered an issue where I need to change the order of the characters in a string in bash, in order to get the ICCID of a sim card. The number I acquire from the modem looks for example like this; 980136010000006187F5. What I need to do is to...

Python: Check for unique characters on a String

python,string,character,unique
I'm asking the user to input a keyword and then remove any duplicate characters. Example: Input: balloon Output: balon I've tried this solution: Python: List of all unique characters in a string but it marks it as a syntax error. Any ideas?...

Method in C# to return the immediate text character of a given character

c#,.net,function,character
How can I implement a function in c# that return the immediate text character of a given text character. The characters should be in alphabetic order. Example: given the character "C" the method should return the character "D".

Conversion NSString to const char string[]

ios,objective-c,arrays,nsstring,character
I have one query related conversion I have one NSString object with content some string like below NSString *string = @"do nothing"; Now I am trying to pass string in below code like const char inputString[] = string; Xcode showing error Array initializer must be an initializer list or string...

How to remove certain characters from a string? [Python]

python,string,character
Say i have a string called cool and cool is set to "cool°" cool = "cool°" how do i remove the degree symbol from the string?...

Converting character to hex in assembler

assembly,hex,character,base,data-conversion
So right now I'm working on reading in a single character from the keyboard and displaying its hex value. At the moment I believe I'm getting the correct hex value, but it is not being displayed correctly. For example, 'k' is 6F in hex, but it's displaying as '6;'. I...

After a integer data type and consecutive two character type. The 2nd character data type skips…Why?

c++,data,types,integer,character
#include<iostream> using namespace std; int main() { int n=0; char name[20]; char address[50]; cout<<"Enter a Number"; cin>>n; cout<<"Enter a Name ="; // HERE gets(name); cout<<"Enter a Address="; gets(address); cout<<"Number ="<<n<<endl; cout<<"Name = "<<name<<endl; cout<<"Address = "<<address<<endl; } It has one Integer type and two array of char type..when the program...

function to select combinations of characters from a string in c++

c++,string,character,combinations
so here is my problem: I need a function that given a string "qwer" of random length can select and put in an array all the possible sequences of characters long from 1 up to the length of the string. I am sorry, it is difficult to explain, but i...

Extra space characters in MS Word translations document [closed]

formatting,ms-word,character,symbols
I have some MS Word documents that were translated from other languages and when I click to turn on the paragraph/hidden formatting symbols setting I see a lot of added little circles where space holders for foreign punctuation would be (it looks like the degree symbol). I want to do...

Special Character: [email protected] before EOF

vim,character
I piped a program's output on the command line into a file and opened it in vim. At the very end of the file is the character: "^@", what does this mean?

Ruby on Rails Display Amount of Characters Remaining for f.text_area

javascript,ruby-on-rails,ruby,character,charactercount
In my Ruby on Rails application I am trying to display the amount of characters remaining for the following text box in the view: <%= f.label :review_text, 'Review Text:' %> And am trying to do so through this java: $(document).ready(function() { $("#review_text").keyup(function() { $("#counter").text(2000 - $(this).val().length); }); }); Which displays...

R - Conditional Substr from dataframe

r,data.frame,character,substring,substr
I need to substr from a column based on start and end locations. The start and end locations are derived from a character search. For example, a single column in Dataframe with 3 rows: 'Bond, Mr. :James' 'Woman, Mrs. :Wonder' 'Hood, Mr. :Robin' Expected Answer in Column 2 is: 'Mr.'...

Why is the alphabet split into multiple ranges in this C code?

c++,c,character,toupper
In a custom library I saw an implementation: inline int is_upper_alpha(char chValue) { if (((chValue >= 'A') && (chValue <= 'I')) || ((chValue >= 'J') && (chValue <= 'R')) || ((chValue >= 'S') && (chValue <= 'Z'))) return 1; return 0; } Is that an Easter egg or what are...

getting character from string and using it as array index… ASM

arrays,assembly,printf,character,nasm
Having trouble using a string array and getting each character from it and adding a 1 to a frequency table of the corresponding ascii index (frequency table is indexed by ascii value): Example, get character 'a' then add 1 to the frequency table of index of the array ['a']. I...

Any other icon characters like '⚠️'

icons,character,emoji
We can output this icon characters, like Emoji on console. For example, on Mac terminal console echo ⚠️ ⚠️ Is there any other characters like '⚠️', so that I can use in shell scripts....

Extract characters that differ between two strings

r,string,character
I have used adist to calculate the number of characters that differ between two strings: a <- "Happy day" b <- "Tappy Pay" adist(a,b) # result 2 Now I would like to extract those character that differ. In my example, I would like to get the string "Hd" (or "TP",...

How does PHP compares characters

php,character,string-comparison
Why does "a" > "b" evaluates to false? It is offcourse because of the alphabet. But how does PHP know that a is smaller than b? var_dump("a" > "b"); //boolean false ...

Unicode range exceeds when try to print in C++

c++,unicode,character
I am trying to print Unicode characters in C++. My Unicode characters are Old Turkic, I have the font. When I use a letter's code it gives me another characters. For example: #include <iostream> #include <string> using namespace std; int main() { string str = "\u10C00" // My character's unicode...

FORTRAN: Use character as changeable array name

arrays,fortran,character
I am trying to write a subroutine to access arrays in a certain manner. One input argument of the subroutine is a character containing the name of the array whose access is desired. Here is a rather simplified code example of how I generally imagine this to work: PROGAM prog...

What is a code point and code space?

character-encoding,character,ascii
I was reading the Wikipedia article on code points, but not sure if I understand correctly. For example, the character encoding scheme ASCII comprises 128 code points in the range 0hex to 7Fhex So is 0hex a code point? Also could not find anything on code space. PS. If it's...

PHP print hex values of characters in a string

php,arrays,string,hex,character
I want to print the hexadecimal values of each of the characters in a PHP string. For example, I want to display the hex values of each character in a string where I'm trying to set the fourth character to Control-C (0x03). $str=sprintf('ab1%c',0x03); for ($cnt=0; $cnt<4; $cnt++) { $chr=$str[$cnt]; echo...

Skeleton code: character pointers struggles

c,arrays,string,pointers,character
So this is part of a skeleton code which reads this csv file: year,month,day,location,mintemp,maxtemp 2015,4,28,18,6.7,12.9 2015,4,28,22,12.7,19.1 2015,4,29,18,7.6,15.3 2015,4,29,22,13.4,21.9 2015,4,30,18,7.3,21.8 2015,4,30,22,13.2,23.2 2015,5,1,18,9.4,15.9 2015,5,1,22,16.1,27.2 2015,5,2,18,8.7,16.3 2015,5,2,22,14.2,21.4 This function reads the file as a string and somehow separates it and puts it into a structure named 'D' of type csv_t. The structure &...

How to read a space in bash - read will not

bash,character,whitespace
Many people have shown how to keep spaces when reading a line in bash. But I have a character based algorithm which need to process each end every character separately - spaces included. Unfortunately I am unable to get bash read to read a single space character from input. while...

PHP-MySQL: Limit data with a specific characters

php,mysql,data,character,limit
I researched the forum but could not find a solution. I have a date in my DB and date format is not like Y-m-d H:i. And the table is not set as date. I need to fetch the date from db but I just need Y-m-d. My date format like:...

Finding and replacing special characters in php

php,html,utf-8,character
Encoding makes this a tough thing to explain. I'm getting a string from an XML file using PHP. When I echo it I see a small black circle: • or • . Oh, stackoverflow renders these, sorry. I meant to say it's the ascii character "bull" or "#8226" echo $str;...

Power Query - remove characters from number values

numbers,character,formula,powerquery
I have a table field where the data contains our memberID numbers followed by character or character + number strings For example: My Data 1234567Z1 2345T10 222222T10Z1 111 111A Should Become 123456 12345 222222 111 111 I want to get just the member number (as shown in Should Become above)....

Comparing characters in C

c,function,character
I have a question about comparing a single char of a string in C inside a function. The code looks like this: int fq(char *s1){ int i; for(i=0;i<strlen(s1);i++){ if(s1[i]=="?"){ printf("yes"); } } return 1; } Even if s1="???" it never prints out yes. I have managed to solve the problem...

How to action a form with JavaScript [closed]

javascript,forms,character,action
I'm new in this domain so please excuse me if I don't speak technically correct. I have a form with a red border. When I enter a character in the form, the red border has to disappear. How can I do this in JavaScript? Thank you very much! ...

How to replace ' with \' in python? [duplicate]

python,replace,character
This question already has an answer here: Replace a character with backslash bug - Python 1 answer I want to replace "'" with "\'" inside the word "O'Fallon". But when I use the following code: City="O'Fallon" City.replace("'","\'") I get "O'Fallon" as the output and when use this code: City="O'Fallon"...

Add character before a variable

php,variables,character
I need to add a character before the number is posted $phone = $_POST['user_phone']; if the user_phone was 123456789, i need it to get converted to 0123456789 before the number is posted....

Java - Replace special character “/”

java,android,string,replace,character
I have a String from a webservice with value "26\/05\/15" (as seen in debugger) or "26/05/15" (as seen on screen) and I want to replace these with the "-" character, but when I want to use this function s.replace("//", "-"); the String remains the same. Any ideas?...

Translation limit in C

c,arrays,string,character
I am attempting to capture input from the user via scanf: char numStrings[5000]; printf("Enter string of numbers:\n\n"); scanf("%s", numStrings); However, the length of the string that is inputted is 5000 characters. The translation limit in c99 is 4095 characters. Do I need to instruct the user to break their input...

Extract all occurrences of characters that differ between two strings

r,string,character
I have used adist to calculate the number of characters that differ between two strings: a <- "#IvoryCoast TENNIS US OPEN Clément «Un beau combat» entre Simon et Cilic" b <- "Clément «Un beau combat» entre Simon et Cilic" adist(a,b) # result 27 Now I would like to extract all...

Wordpress- block characters in custom input field

wordpress,input,character,block
Can enybody help me with block special characters in my custom field in front-end? I want add this block only for one field with specific #id. Thanks!...

undesirable character displayed when executing [closed]

c,character
I have some troubles when executing my program, some characters appeared out of nowhere ( especially this one : and sometimes others) , I don't understand where is the problem and how to delet them. Thank you. #include <stdio.h> #include <stdlib.h> #include <magic.h> #include <string.h> typedef struct Chaine { char...

How can I test if a string is made up from different characters only? [duplicate]

c#,string,character
This question already has an answer here: How to get distinct characters in c# 6 answers I have a 5 character long string from Console.Readline() and I want to test if all 5 characters are different. ...