int

C# Convert String to Integer

时光怂恿深爱的人放手 提交于 2020-05-09 09:49:01
问题 I have finally taken the jump from VB.net to C# so I'm still having some issues. I am making a simple weather app that connects through a RSS feed. I want it to return a label that determines if it is freezing outside, however; I am having issues converting the temperature string to an integer so I can determine if the temperature is less than or equal to 32 degrees. Any ideas? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing

C# Convert String to Integer

余生长醉 提交于 2020-05-09 09:48:50
问题 I have finally taken the jump from VB.net to C# so I'm still having some issues. I am making a simple weather app that connects through a RSS feed. I want it to return a label that determines if it is freezing outside, however; I am having issues converting the temperature string to an integer so I can determine if the temperature is less than or equal to 32 degrees. Any ideas? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing

C# Convert String to Integer

◇◆丶佛笑我妖孽 提交于 2020-05-09 09:48:05
问题 I have finally taken the jump from VB.net to C# so I'm still having some issues. I am making a simple weather app that connects through a RSS feed. I want it to return a label that determines if it is freezing outside, however; I am having issues converting the temperature string to an integer so I can determine if the temperature is less than or equal to 32 degrees. Any ideas? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing

Int equivalent of string.isempty

拥有回忆 提交于 2020-04-30 08:46:21
问题 I am hoping this is an easy fix. I am after a way to detect that the user has hit the enter key when prompted for an int value. I know the .isEmpty does not work with values declared as int, what is the best way to get around this? System.out.println("Please enter the first number:"); user_number1 = input.nextInt(); if (user_number1.isEmpty){ } 回答1: There is no way for an int to be empty. input.nextInt() will not proceed until the user enters a value that is not whitespace. If it's not an int

Int equivalent of string.isempty

纵然是瞬间 提交于 2020-04-30 08:46:16
问题 I am hoping this is an easy fix. I am after a way to detect that the user has hit the enter key when prompted for an int value. I know the .isEmpty does not work with values declared as int, what is the best way to get around this? System.out.println("Please enter the first number:"); user_number1 = input.nextInt(); if (user_number1.isEmpty){ } 回答1: There is no way for an int to be empty. input.nextInt() will not proceed until the user enters a value that is not whitespace. If it's not an int

Converting strings to int in C#

半腔热情 提交于 2020-04-30 07:49:36
问题 im pretty new to C# and i want to make a cardgame. What i have is a list of cards (strings) with names like c6, s3, h11, d13 where the character represents the colour and the number represents the value . When pressing a button the program takes a random string from the list and displays it in a textbox. From there the point of the game is to guess if the next random card will have a higher value or a lower value then the previous card. What i want to do is to take the string from the textbox

Converting strings to int in C#

三世轮回 提交于 2020-04-30 07:48:50
问题 im pretty new to C# and i want to make a cardgame. What i have is a list of cards (strings) with names like c6, s3, h11, d13 where the character represents the colour and the number represents the value . When pressing a button the program takes a random string from the list and displays it in a textbox. From there the point of the game is to guess if the next random card will have a higher value or a lower value then the previous card. What i want to do is to take the string from the textbox

Problem when trying to create another call? Call related to how many times a value appears in the list

夙愿已清 提交于 2020-04-17 19:06:21
问题 Here is the code: from typing import Any list = list(range(1, 41)) print(list) listValues = [] for i in range(1, 5): # 1,2,3,4 value = int(input("Digite o valor:" + str(i) + ":")) # Digite o valor listValues.append(value) print(value) for value in listValues: print(value) if value in list: print("Valor " + str(value) + " encontrado.") else: print("Valor " + str(value) + " não encontrado.") value = int(input("Digite o valor, para achar a posição:" +str(i) + ":")) pos = listValues.append(value)

Problem when trying to create another call? Call related to how many times a value appears in the list

一曲冷凌霜 提交于 2020-04-17 19:00:16
问题 Here is the code: from typing import Any list = list(range(1, 41)) print(list) listValues = [] for i in range(1, 5): # 1,2,3,4 value = int(input("Digite o valor:" + str(i) + ":")) # Digite o valor listValues.append(value) print(value) for value in listValues: print(value) if value in list: print("Valor " + str(value) + " encontrado.") else: print("Valor " + str(value) + " não encontrado.") value = int(input("Digite o valor, para achar a posição:" +str(i) + ":")) pos = listValues.append(value)

Convert number in textview to int

喜你入骨 提交于 2020-04-08 09:20:16
问题 So, I am messing around with java/android programming and right now I am trying to make a really basic calculator. I am hung up on this issue though. This is the code I have right now for getting the number thats in the textview and making it an int CharSequence value1 = getText(R.id.textView); int num1 = Integer.parseInt(value1.toString()); And from what I can tell it is the second line that is causing the error, but im not sure why it is doing that. It is compiling fine, but when it tries