Questions tagged as 'c#'

2
answers

Unity: character walks sideways rather than head-on

Hi, I have a question on Unity3D 5! My character, instead of moving forward, with WASD, he moves sideways. My script: using UnityEngine; public class PlayerController : MonoBehaviour { void Update() { var x = Input.GetAxis(...
asked by 04.10.2018 / 19:05
3
answers

How to compare two List and delete repeated fields?

How to compare lista1 and lista2 , excluding repeated items in one of them?     
asked by 09.01.2017 / 14:45
2
answers

Return with 2 Values C # [duplicate]

I want to give return of two values in C #. My code is so currently, just returning imagePath , but I want to return imagePath and normalPath at the same time. string imagePath = "~/Images/QrCode.jpg"; string norma...
asked by 18.04.2018 / 18:36
3
answers

Verify that all fields in an entity are null

I'm doing a check of an entity view model in C# and I have to validate if all fields are null , because I have to require at least 1 filter to continue the routine. Doubt : What is the simplest and best way to do this?...
asked by 27.12.2018 / 12:23
3
answers

Remove non-numeric characters from a string

Example: I have the following string    "M1245D454" I need only leave the numbers on it. M and D, are examples, I want to remove any non-numeric character. Is there any function in C # or VB.NET for this?     
asked by 14.04.2016 / 21:35
3
answers

How to compare strings in case sensitive?

I have following code: Usuarios user = DataModel.Usuarios.Where(x => x.Login.Equals(login,StringComparison.OrdinalIgnoreCase) && x.Senha.Equals(senha,StringComparison.Ordinal)).FirstOrDefault(); I would like to get the following...
asked by 13.10.2017 / 05:54
2
answers

Regex - Removal of Special Characters C #

Regex.Replace is a great solution to remove accent. Now I just can not remove a character type, I have a string that receives the text "1st General Place" , in the string it has the character '°' / strong>, is there a list for these types...
asked by 19.07.2014 / 19:07
2
answers

Encapsulation confusing in C #

I was creating a template that in its construtor I set the Nome attribute. however, this attribute will only have get , as opposed to java oc # has the resource for getters and setters I thought I would simply d...
asked by 14.03.2014 / 20:50
3
answers

What is the best way to check the existence of a record in the database via the application?

Today I use a method that sends a COUNT with the record Id as a parameter to the database. Is there a better, perhaps more performative way to do this?     
asked by 27.02.2015 / 14:38
2
answers

How to cut a string?

Example: nome = "Josénildo da Silva Ramos do Carmo"; Cut to have up to X characters, thus: nome = "Josénildo da Silva "; In the case I cut it to 20 characters. How do I do this in C #? I only know in C (which is vector). In C # I...
asked by 14.07.2015 / 01:35