Here you can find the source of toUnsignedInt(String string)
Parameter | Description |
---|---|
string | string to convert to int |
public static int toUnsignedInt(String string)
//package com.java2s; /*//w w w.ja va 2s . c o m * Copyright Siemens AG, 2014-2016. * With modifications by Bosch Software Innovations GmbH, 2016 * Part of the SW360 Portal Project. * * SPDX-License-Identifier: EPL-1.0 * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ public class Main { /** * @param string string to convert to int * @return int value if input positive, negative on error */ public static int toUnsignedInt(String string) { int integer = -1; try { integer = Integer.valueOf(string); } catch (NullPointerException | NumberFormatException ignored) { // sic. } return integer; } }