Questions tagged [character]

Refers to a symbol that represents a letter or number. Also, the bit pattern used to represent such a symbol.

In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written form of a natural language. Examples of characters include letters, numerical digits, and common punctuation marks (such as '.' or '-'). The concept also includes control characters, which do not correspond to symbols in a particular natural language, but rather to other bits of information used to process text in one or more languages. Computers and communication equipment represent characters using a character encoding that assigns each character to something — an integer quantity represented by a sequence of bits, typically — that can be stored or transmitted through a network. Two examples of popular encodings are ASCII and the UTF-8 encoding for Unicode.

7762 questions
2
votes
3 answers

replace characters in string with regex JS

I want to replace multiple characters in a string using regex. I am trying to swap letters A and T as well as G and C. function replacer(string) { return "String " + string + " is " + string.replace(/A|T|G|C/g, "A","T","G","C"); } do I have the…
MaxES
  • 81
  • 1
  • 7
2
votes
2 answers

Getting an equality test to work with char's and an array

I've been given the task to create a method that takes in a single char and does an equality check to see if it matches any char in an array. For the number of times that a match is found, a counter is supposed to go up. I'm pretty sure that the…
2
votes
2 answers

Checking abc alphabet on C language

I just started to learn loops on C language. Write a program that checks if the input of abc alphabet is correct, the input is small letters form abc alphabet, asume that the input is orderd, if misissing some latters you should add the missing…
Error 404
  • 427
  • 5
  • 25
2
votes
3 answers

Find indices of elements in a dataframe based on character comparison (using e.g. grepl)

I have a large dataframe containing bank characteristica from which i want so filter certain banks based on their names. Assume df is my large dataframe, containing inter alia the bank names: df <- data.frame(bank = c("BNP PARIBAS", "DEUTSCHE BANK…
jb123
  • 197
  • 2
  • 12
2
votes
2 answers

How to sequence a sliding window of with step 2 on character vector in r

I know how to code for sequencing a sliding window of 3 with step 1 in a character vector, but would step 2 require a seq function? So for step 1: v <- c("ace", "king", "queen", "jack", "joker") for(i in 1:3) { print(paste(v[i], v[i + 1], v[i…
Monique
  • 43
  • 2
  • 9
2
votes
2 answers

encoding special characters in java

I have a string message to display which contains special characters but it doesnt print all. For example if I give message like "The P & A company does the work". It prints only "The P". public void setOutageMsg(String outageMsg) { //outage…
2
votes
3 answers

How to detect certain special characters in perl string?

I want to detect the presence of certain characters like @ # $ % \ / in a Perl string. Can anyone suggest a regex for this. I tried few but it is not working. =~ /(\W@\W#\W%\W*)/) =~ /(@|#|%|*)/) I tried these but it is not working. Can anyone…
dev_k2.0
  • 39
  • 1
  • 1
  • 4
2
votes
1 answer

HTML representation of '»'

I'm looking for the HTML notation for ». I found ≫, but that gives ≫, not the smaller »?
patrick
  • 11,519
  • 8
  • 71
  • 80
2
votes
2 answers

str_replace with special characters

$fetched_column['title'] = str_replace(' ', '', $fetched_column['title']); echo $fetched_column['title'] . '
'; When it echos out it strips the white_space but doesn't replace it with . I'm guessing because of the < >. Don't know how to…
PirateTube
  • 97
  • 1
  • 10
2
votes
1 answer

remap scrambled PDF characters to readable text

I do have a problem due to cups-PDF creating PDF documents where characters are mapped to strange symbols [on Ubuntu Linux 14.04 and 16.04}. I think its some kind of unicode even if Python is telling me its string type. type(object) python returns…
Mister Wong
  • 53
  • 2
  • 4
2
votes
1 answer

how to use pyspark saveAsTextFile deal Chinese characters

I am using pyspark to do word count thing. There are lots of Chinese word. I want to save the result into file, but saveAsTextFile() can not write correct Chinese character into file. that's my code sc = SparkContext() # read files dir_path =…
vera
  • 45
  • 1
  • 6
2
votes
3 answers

python counting charaters without spaces in a file

how do you count charcters with out spaces? I am not getting the right number. The right number of num_charsx is 1761 num_words = 0 num_chars = 0 with open("C:/Python33/fire.txt",'r') as f: for line in f: words = line.split('\n') …
Min Woo Kim
  • 29
  • 1
  • 4
2
votes
3 answers

Python loop - help me understand

I have python to generate a random code, in this case, "Lucy", and it prints as follows: L Lu Luc Lucy I don't understand how it works, can someone explain? import sys mysteryString = sys.argv[1] print("~ testing with mysteryString = {}…
Katie Stearns
  • 55
  • 1
  • 1
  • 7
2
votes
1 answer

In C how do I detect whether an input is a character or integer at the same time?

Quite new to C so apologies for the long read and no doubt rubbish programming. So my program is reading in a CSV file, containing the specification of 15 different transistors. It then compares an input to the data from the CSV file. After the data…
2
votes
2 answers

C program to count how many vowels in a list of input words

I need to write a program to count how many vowels (‘a’, ‘e’, ‘i’, ‘o’, ‘u’) in a list of input words. My program reads the words one by one and prints the number of vowels occurring in each word. Each word consists of only alphabets in mixed cases.…
Han Sen
  • 77
  • 3
1 2 3
99
100