HOIT_B

[프로그래머스 C# ] 문자열의 뒤의 n글자 본문

작고소중한 알고리즘 풀기

[프로그래머스 C# ] 문자열의 뒤의 n글자

HOIT_77 2023. 9. 20. 19:49
728x90

https://school.programmers.co.kr/learn/courses/30/lessons/181910

 

프로그래머스

코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.

programmers.co.kr

 

 

using System;

public class Solution {
    public string solution(string my_string, int n) {
        string answer = "";
        
        
        answer = my_string.Substring(my_string.Length-n,n );
        
        
        return answer;
    }
}
728x90
Comments